• + 1 comment
        int round = (x1+v1)*(x2+v2);
        for (int i = 0; i < round; i++) {
            if(x1+v1 == x2+v2){
                return "YES";
            }
            x1 +=v1;
            x2 +=v2;
        }
        return "NO";