Problem:
Score : 200 points

Problem Statement

Two children are playing tag on a number line. (In the game of tag, the child called "it" tries to catch the other child.) The child who is "it" is now at coordinate A, and he can travel the distance of V per second.
The other child is now at coordinate B, and she can travel the distance of W per second.

He can catch her when his coordinate is the same as hers.
Determine whether he can catch her within T seconds (including exactly T seconds later).
We assume that both children move optimally.

Constraints

-10^9 \leq A,B \leq 10^9

1 \leq V,W \leq 10^9

1 \leq T \leq 10^9

A \neq B

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A V
B W
T

Output

If "it" can catch the other child, print YES; otherwise, print NO.

Sample Input 1

1 2
3 1
3

Sample Output 1

YES

Sample Input 2

1 2
3 2
3

Sample Output 2

NO

Sample Input 3

1 2
3 3
3

Sample Output 3

NO

Solution in Rust (1.42.0) (judge verdict: Wrong Answer)

use std::io;

fn main() {
    let mut A = String::new();
    let mut B = String::new();
    let mut T = String::new();
    io::stdin().read_line(&mut A);
    io::stdin().read_line(&mut B);
    io::stdin().read_line(&mut T);
    let mut vecA :Vec<&str> = A.trim().split_whitespace().collect();
    let mut vecB :Vec<&str> = B.trim().split_whitespace().collect();
    let mut t :usize = T.trim().parse().unwrap();
    let mut a :i64 = vecA[0].parse().unwrap();
    let mut v :i64 = vecA[1].parse().unwrap();
    let mut b :i64 = vecB[0].parse().unwrap();
    let mut w :i64 = vecB[1].parse().unwrap();
    let mut oni :i64 = a;
    let mut ko :i64 = b;
    let mut afterA1 :i64 = 0;
    let mut afterA2 :i64 = 0;
    let mut afterK1 :i64 = 0;
    let mut afterK2 :i64 = 0;
    for i in 0..t {
        let mut after_ko1 :i64 = ko + w;
        let mut after_ko2 :i64 = ko - w;
        if(after_ko1 == oni + v || after_ko1 == oni - v){
            if(after_ko2 == oni + v || after_ko2 == oni - v){
                println!("YES");
                return ()
            }
        }
        let mut after1 :i64 = (after_ko1 - oni - v).abs();
        let mut after2 :i64 = (after_ko1 - oni + v).abs();
        let mut after3 :i64 = (after_ko2 - oni - v).abs();
        let mut after4 :i64 = (after_ko2 - oni + v).abs();
        if((after1 - after2) > 0){
            afterK1 = after2;
            afterA1 = oni - v;
        }else{
            afterK1 = after1;
            afterA1 = oni + v;
        }
        if((after3 - after4) > 0){
            afterK2 = after4;
            afterA2 = oni - v;
        }else{
            afterK2 = after3;
            afterA2 = oni + v;
        }
        if((afterK1 - afterK2) > 0){
            ko = after_ko1;
            oni = afterA1;
        }else{
            ko = after_ko2;
            oni = afterA2;
        }
        println!("oni{} :{}",i,oni);
        println!("ko{} :{}",i,ko);
    }
    println!("NO"); 
}