• + 1 comment

    Same problem with me, though this would be my main()-Method (Java)... and by now I found the mistake due to another post. (Damn it's one of those really simple mistakes.):

        Scanner scan = new Scanner(System.in);
        int x1, x2, x, v1, v2, v;
        long n;
        String result = "NO";
    
        x1 = scan.nextInt();
        v1 = scan.nextInt();
        x2 = scan.nextInt();
        v2 = scan.nextInt();
    
        x = x1 - x2;
        v = v2 - v1;
        n = x / v;
    
        if ((n > 0) && (n * v == x)){
            result = "YES";
        }
    
        System.out.println(result);