Skip to content

Instantly share code, notes, and snippets.

@torpedo87
Created March 6, 2017 02:09
Show Gist options
  • Save torpedo87/dc28b72460b6534ce4f64cbf20fca296 to your computer and use it in GitHub Desktop.
Save torpedo87/dc28b72460b6534ce4f64cbf20fca296 to your computer and use it in GitHub Desktop.
function main() {
var x1_temp = readLine().split(' ');
var x1 = parseInt(x1_temp[0]);
var v1 = parseInt(x1_temp[1]);
var x2 = parseInt(x1_temp[2]);
var v2 = parseInt(x1_temp[3]);
var n = (x2-x1)/(v1-v2);
if(Number.isInteger(n) && n>0){
console.log("YES");
}else{
console.log("NO");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment