-
-
Save shinchit/6e42d7b4a28f64970ecc647565a7cd07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This sample code is also a solution to the problem at the following URL of atcoder. | |
* https://atcoder.jp/contests/abc178/tasks/abc178_b | |
*/ | |
"use strict" | |
function Main(input) { | |
// Recieve input | |
let lines = input.split('\n'); | |
const [a, b, c, d] = lines[0].split(' ').map(BigInt); | |
// Process data | |
let product_matrix = []; | |
product_matrix.push(a * c); | |
product_matrix.push(a * d); | |
product_matrix.push(b * c); | |
product_matrix.push(b * d); | |
const max = product_matrix.reduce((a,b)=>a>b?a:b) | |
// Print output | |
console.log(max.toString()); | |
} | |
Main(require("fs").readFileSync("/dev/stdin", "utf8")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment