jiahuimbzuai/CoQuIR huggingface dataset:
//  [rust]
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use text_io::*;

fn main() {
    let n: usize = read!();
    let mut abc = Vec::with_capacity(n);
    for _ in 0..n {
        let a: usize = read!();
        let b: usize = read!();
        let c: usize = read!();
        abc.push([a, b, c]);
    }

    let mut dp = vec![vec![0; 3]; n + 10];

    for i in 1..=n {
        for j in 0..3 {
            let iter = (0..3).filter(|&jj| jj != j);
            for k in iter {
                dp[i][j] = dp[i][j].max(dp[i - 1][k] + abc[i - 1][k]);
            }
        }
    }

    println!("{}", [dp[n][0], dp[n][1], dp[n][2]].iter().max().unwrap());
}
//  [rust]
use std::io::prelude::*;

fn input<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

fn main() {
    let n: usize = input();
    let abc: Vec<Vec<i64>> = (0..n).map(|_| (0..3).map(|_| input()).collect()).collect();

    let mut v = vec![vec![0; 3]; n + 1];
    for i in 1..n + 1 {
        v[i][0] = abc[i - 1][0] + std::cmp::max(v[i - 1][1], v[i - 1][2]);
        v[i][1] = abc[i - 1][1] + std::cmp::max(v[i - 1][2], v[i - 1][0]);
        v[i][2] = abc[i - 1][2] + std::cmp::max(v[i - 1][0], v[i - 1][1]);
    }

    println!("{}", v[n].iter().max().unwrap());
}
//  [swift]
let N = Int(readLine()!)!

var a = 0
var b = 0
var c = 0

for _ in 0..<N {
  let inp = readLine()!.split(separator: " ").map { Int($0)! }
  let a1 = inp[0]
  let b1 = inp[1]
  let c1 = inp[2]
  let _a = a
  let _b = b
  let _c = c
  a = max(_b, _c) + a1
  b = max(_a, _c) + b1
  c = max(_a, _b) + c1
}

print(max(max(a, b), c))
//  [swift]
let n = Int(readLine()!)!

let tasks = (1...n).map { _ in
    return readLine()!.split(separator: " ").map { Int($0)! }
}

var dpA = [Int](repeating: 0, count: n)
var dpB = [Int](repeating: 0, count: n)
var dpC = [Int](repeating: 0, count: n)

dpA[0] = tasks[0][0]
dpB[0] = tasks[0][1]
dpC[0] = tasks[0][2]
for i in 1..<n {
    dpA[i] = tasks[i][0] + max(dpB[i-1], dpC[i-1])
    dpB[i] = tasks[i][1] + max(dpA[i-1], dpC[i-1])
    dpC[i] = tasks[i][2] + max(dpA[i-1], dpB[i-1])
}

print(max(dpA[n-1], dpB[n-1], dpC[n-1]))
//  [swift]
/// Swift5 -> Swift2.2
extension String {
    // split(separator:maxSplits:omittingEmptySubsequences:)
    func split(separator separator: Character) -> [String] {
        return self.characters.split(separator).map(String.init)
    }
}
extension Array {
    // init(repeating:count:)
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
extension Array where Element: Comparable {
    // sorted()
    func sorted() -> [Element] {
        return self.sort( { $0 < $1 } )
    }
}
// stride(from:through:by:)
func stride(from start: Int, through end: Int, by stride: Int) -> StrideThrough<Int> {
    return start.stride(through: end, by: stride)
}
/// end

let N = Int(readLine()!)!

enum Activity {
    case swimming, catching, homework
}

var happiness = [[Activity: Int]]()
happiness.append([:])
for _ in 0 ..< N {
    let input = readLine()!.split(separator: " ").map { Int($0)! }
    happiness.append([
        .swimming: input[0],
        .catching: input[1],
        .homework: input[2]
    ])
}

var dp = Array(repeating: [Activity: Int](), count: N + 1)
dp[1][.swimming] = happiness[1][.swimming]
dp[1][.catching] = happiness[1][.catching]
dp[1][.homework] = happiness[1][.homework]

for i in stride(from: 2, through: N, by: 1) {
    dp[i][.swimming] = max(
        dp[i - 1][.catching]! + happiness[i][.swimming]!,
        dp[i - 1][.homework]! + happiness[i][.swimming]!
    )

    dp[i][.catching] = max(
        dp[i - 1][.swimming]! + happiness[i][.catching]!,
        dp[i - 1][.homework]! + happiness[i][.catching]!
    )

    dp[i][.homework] = max(
        dp[i - 1][.swimming]! + happiness[i][.homework]!,
        dp[i - 1][.catching]! + happiness[i][.homework]!
    )
}

print(dp.last!.map { $1 }.sorted().last!)
//  [typescript]
import * as fs from "fs";

// inputで受け取り配列化する
const input = fs.readFileSync("/dev/stdin", "utf8").split("\n");
const N = Number(input.shift());
const h = input.map((row) => row.split(" ").map(Number));

const createZeroArray = () => Array(3).fill(0).slice(0, 3);

const dp = [];

for (let n = 0; n < N; n++) {
  const arr = [];
  for (let num = 0; num < 3; num++) {
    arr.push(0);
  }
  dp.push(arr);
}

for (let index = 0; index < 3; index++) {
  dp[0][index] = h[0][index];
}

// present day
for (let i = 1; i < N; i++) {
  // previous select
  for (let j = 0; j < 3; j++) {
    // today's select
    for (let k = 0; k < 3; k++) {
      if (j === k) continue;
      dp[i][k] = Math.max(dp[i][k], dp[i - 1][j] + h[i][k]);
    }
  }
}

console.log(Math.max(...dp[N - 1]));
//  [typescript]
import * as fs from "fs"

// ############################################################ //

// 2次元配列の行と列を入れ替える
const transpose = <T>(a: Array<Array<T>>) =>
  a[0].map((_, c) => a.map((r) => r[c]))

// 配列を作成して指定された値で初期化する
const createArray = <T>(length: number, initialValue: T): T[] => {
  const ary = []
  for (let i = 0; i < length; i++) {
    ary.push(initialValue)
  }
  return ary
}

// 配列の初期化などで使える、整数値の上限下限（これ同士を足してもオーバーフローしない）
const NUMBER_MAX = Math.floor(Number.MAX_SAFE_INTEGER / 2)
const NUMBER_MIN = Math.ceil(Number.MIN_SAFE_INTEGER / 2)

// ############################################################ //

const process = (n: number, a: number[], b: number[], c: number[]): string => {
  // 最後に各行動を選んだときの幸福度
  let ha = 0
  let hb = 0
  let hc = 0

  for (let i = 0; i < n; i++) {
    // 一時変数を使わないと、足された後の数で計算されてしまう
    let tempA = 0
    let tempB = 0
    let tempC = 0

    // ha
    // 行動 A は選べない
    if (hb > hc) {
      tempA += a[i] + hb
    } else {
      tempA += a[i] + hc
    }

    // hb
    if (ha > hc) {
      tempB += b[i] + ha
    } else {
      tempB += b[i] + hc
    }

    // hc
    if (ha > hb) {
      tempC += c[i] + ha
    } else {
      tempC += c[i] + hb
    }

    // 対比していた今回の幸福度を足す
    ha = tempA
    hb = tempB
    hc = tempC
  }

  // 一番幸福度が大きいものを返す
  if (ha > hb && ha > hc) {
    return ha + ""
  } else if (hb > ha && hb > hc) {
    return hb + ""
  }
  return hc + ""
}

const Main = (input: string): string => {
  const aa: string[][] = input.split("\n").map((e) => e.split(" "))
  const n: number = parseInt(aa[0][0])
  const abc = transpose(aa.slice(1).map((e) => e.map((e2) => parseInt(e2))))

  const res = process(n, abc[0], abc[1], abc[2]) + ""
  console.log(res)
  return res
}
 Main(fs.readFileSync("/dev/stdin", "utf8"))
//  [typescript]
// https://atcoder.jp/contests/dp/tasks/dp_b

import * as fs from "fs";

const split = (str: string): string[] =>
  str.split(" ").map((v: string) => v.trim());
const split_number = (str: string): number[] =>
  split(str).map((v: string) => +v);

export function main(input: string) {
  const lines = input.split("\n");
  const [n] = split_number(lines[0]);

  // Playの初期化
  let play: number[][] = [];
  for (let i = 0; i < n; i++) {
    play[i] = split_number(lines[i + 1]);
  }

  // DP値の初期化
  let dp: number[][] = [];
  for (let i = 0; i < n + 1; i++) {
    dp[i] = [0, 0, 0];
  }

  for (let i = 0; i < n; i++) {
    for (let j = 0; j < 3; j++) {
      for (let k = 0; k < 3; k++) {
        if (j != k) {
          dp[i + 1][k] = Math.max(dp[i + 1][k], dp[i][j] + play[i][k]);
        }
      }
    }
  }

  return Math.max(...dp[n]);
}

if (!process.env.LOCAL_DEBUG) {
  console.log(main(fs.readFileSync("/dev/stdin", "utf8")));
}
//  [typescript]
const lines: string[] = [];
const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});
reader.on("line", function (line: string) {
  lines.push(line);
});

reader.on("close", function () {
  const rule = lines.shift().split(" ").map(Number);
  const data: any = lines.map((line) => {
    return line.split(" ").map((int) => parseInt(int));
  });

  const dp = [];
  dp.push(data[0]);
  for (let i = 1; i < rule[0]; i++) {
    dp.push(new Array(3).fill(-1));
  }

  for (let i = 1; i < rule[0]; i++) {
    for (let j = 0; j < 3; j++) {
      for (let k = 0; k < 3; k++) {
        if (j !== k) {
          dp[i][k] = Math.max(dp[i][k], dp[i - 1][j] + data[i][k]);
        }
      }
    }
  }
  console.log(Math.max.apply(null, dp[rule[0] - 1]));
});
//  [python]
import collections
import math
import numpy as np
#H, W, K = map(int, input().split(' '))
# S = input()
# if S[2] == S[3]:
#     if S[4] == S[5]:
#         print('Yes')
#         exit()
# else:
#     print('No')

S = int(input())
gohyaku, amari = divmod(S, 500)
go, amari = divmod(amari, 5)

print(1000*gohyaku+go*5)
//  [python]
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
from fractions import gcd
from copy import deepcopy
import math
import queue
import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
import sys
sys.setrecursionlimit(100000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

def main(): #startline-------------------------------------------
    ans = 0
    x = int(input())
    while not(x < 500):
        ans += 1000
        x -= 500
    while not(x < 5):
        ans += 5
        x -= 5
    print(ans)
if __name__ == "__main__":
    main() #endline===============================================
//  [python]
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

X = int(sys.stdin.buffer.readline())
a = X // 500
b = (X % 500) // 5
print( a * 1000 + b * 5)
//  [java]

import java.util.Scanner;

public class Main{
	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);

		int X = sc.nextInt();
		int ans = 0;

		for (int i = 0; i< 1000000000; i++ ) {
			if (X >= 500) {
			X = X - 500;
			ans =ans+ 1000;
			}
		}

		for (int i = 0; i< 1000000000; i++ ) {
			if (X >= 5) {
			X = X - 5;
			ans =ans+ 5;
			}
		}
		System.out.print(ans);
			}

	}
//  [java]

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main implements Runnable { //クラス名はMain1

	public static void main(String[] args) {
		Thread.setDefaultUncaughtExceptionHandler((t, e) -> System.exit(1));
		new Thread(null, new Main(), "", 1024 * 1024 * 1024).start(); //16MBスタックを確保して実行
	}

	/**
	 * for (int i = 0; i < N; i++) {}
	 * System.out.println();
	 * HashMap<Integer, Integer> hm = new HashMap<>();
	 * int[] s = new int[M];
	 * ArrayDeque<Integer> deq = new ArrayDeque<>();
	 *
	 * 文字列のSort
	 * String sorted = S.chars()
						.sorted()
						.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append)
						.toString();
	 * for (char i = 'a'; i <= 'z'; i++) {}
	 */
	public void run() {
		FastScannerMainB sc = new FastScannerMainB(System.in);

		try {
			//String S = sc.nextLine().trim();

			//int[] a = new int[N];
			//long l = sc.nextLong();
			//ArrayList<Integer> arr = new ArrayList<Integer>();
			//for (int i = 0; i < N; i++) {}
			//for (char i = 'a'; i <= 'z'; i++) {}
			long X = sc.nextLong();
			long X2 = X;
			long count = 0;

			long x500 = X / 500;

			count = 1000 * x500;

			//System.out.println(X / 500);
			//System.out.println(count);
			count += 5 * ((X - 500 * (X / 500)) / 5);
			System.out.println(count);

			/*
			while (true) {
				if (X2 >= 500) {
					X2 = X2 - 500;
					count = count + 1000;
				}
				if (X2 >= 5) {
					X2 = X2 - 5;
					count = count + 5;
				}
				if (X2 < 5) {
					break;
				}
			}
			*/

			//System.out.println(count);

		} catch (Exception e) {
			e.printStackTrace();
		}

	}
}

//高速なScanner
class FastScannerMainB {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScannerMainB(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}
//  [cpp]

// <------------- Template -----------------------> //

/*
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
*/

#pragma optimization_level 3   									//Comment optimisations for an interatcive problem - use endl
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include<bits/stdc++.h>
using namespace std;

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);	
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll ,ll> 			pll;
typedef pair<ld,ld> 			pld;
typedef unordered_map<ll,ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5+7;
const ll 	MAX7 	= 	1e+7+7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9+7;

vll adj[MAXN];ll visit[MAXN]={};
int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1};
int dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};

// <------------- Declare Variables Here ------------> //

ll t=1;
ll n,x,m,a,y,b,k,c;
string s;

// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	cin>>n;
	ll ans = n/500*1000;
	n%=500;
	ans+=(n/5)*5;
	cout<<ans;newl;
}

int main() {
	fastio;randomINT;
	//cin>>t;
	while(t--) {
		MAIN();
	}
	return 0;
}
//  [c]
#include <stdio.h>

int main(void){
	long int a=0;
	long int ans=0;
	scanf("%ld",&a);
	
	ans += (a/500) * 1000;
	ans += (a-ans/2)/5 * 5;
	
	printf("%ld\n",ans);
	return 0;
}
//  [c]
#include <stdio.h>
int main(){
	int gohyaku,go,nokori,amari,kekka;
	
	scanf("%d", &nokori);
	gohyaku=nokori/500;
	amari = nokori % 500;
	go = amari / 5;
	kekka = gohyaku * 1000 + go * 5;
		printf("%d\n",kekka);
	
	return 0;
}
//  [c]
#include<stdio.h>

int main()
{
    int h,d,e,f,p;
    scanf("%d",&h);
    d=h/500;
    e=h%500;
    f=e/5;
    p=d*1000+f*5;
    printf("%d",p);
    return 0;
}
//  [javascript]
'use strict';
function Main(input) {
  const coins = Number.parseInt(input, 10);
  let maxCoins500 = Math.floor(coins / 500);
  for (let i = maxCoins500; 0 <= i; --i) {
    for (let j = 0; j < 1000; ++j){
      const remain = coins - (500 * i + 5 * j);
      if (remain < 0 || remain < 5) {
        console.log(1000 * i + 5 * j);
        return;
      }
    }
  }
  console.log(0);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";

var processData = function processData(lines) {
  var x = +lines[0];
  var r = Math.floor(x / 500);
  var f = Math.floor(x % 500 / 5);
  console.log(r * 1000 + f * 5);
};

var i = '';
process.stdin.on('data', function (c) {
  return i += c;
});
process.stdin.on('end', function () {
  var _require = require('os'),
      EOL = _require.EOL;

  var lines = i.split(EOL);
  /*your input text, split by lines*/

  processData(lines);
});
//  [javascript]
"use strict";

const fs = require("fs");

const lines = fs.readFileSync("/dev/stdin", "utf-8").split("\n");
lines.pop();

let amount = Number(lines[0]);
let result = 0;

result += Math.floor(amount / 500) * 1000;
amount %= 500;

result += Math.floor(amount / 5) * 5;

console.log(result);
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const (
	initialBufSize = 10000
	maxBufSize     = 1000000009
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

func main() {
	X := nextInt()
	ans := (X/500)*1000 + ((X%500)/5)*5
	fmt.Println(ans)
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	scan_init()
	x := scanInt()
	sum := 0
	sum += 1000 * (x/500)
	sum += 5 * ((x%500)/5)
	fmt.Print(sum)
}

var sc = bufio.NewScanner(os.Stdin)

func scan_init() {
	sc.Split(bufio.ScanWords)
}
func scanInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func scan() string {
	sc.Scan()
	return sc.Text()
}

var rdr = bufio.NewReaderSize(os.Stdin, 200000)

func readLine() string {
	buf := make([]byte, 0, 200000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
func readLineToNumber() int {
	S := readLine()
	number, _ := strconv.Atoi(S)
	return number
}
func readLineToSlice() []string {
	S := readLine()
	list := strings.Split(S, "")
	return list
}
func readLineToNumberSlice(memo map[string]int) []int {
	// err時は-1を代入
	S := readLine()
	intList := make([]int, len(S))
	for i := 0; i < len(S); i++ {
		if val, ok := memo[string(S[i])]; ok {
			intList[i] = val
		} else {
			intList[i] = -1
		}
	}
	return intList
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	X := readI()

	ans := 0
	for X/500 != 0 {
		ans += 1000
		X -= 500
	}
	for X/5 != 0 {
		ans += 5
		X -= 5
	}
	fmt.Println(ans)
}

/*-----------Utils-----------*/

var sc = bufio.NewScanner(os.Stdin)

func init() {
	if len(os.Args) >= 2 {
		if os.Args[1] == "debug" {
			debug()
		}
	}
	const maxBuf = 200100
	var buf []byte = make([]byte, maxBuf)
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBuf)
}

func debug() {
	testFile, err := os.Open("./test/sample-1.in")
	if err != nil {
		fmt.Fprintln(os.Stderr, "Error : There is no testfile.")
		os.Exit(1)
	}
	sc = bufio.NewScanner(testFile)
}

func readS() string {
	sc.Scan()
	return sc.Text()
}

func readSs(a int) []string {
	b := make([]string, a)
	for i := 0; i < a; i++ {
		b[i] = readS()
	}
	return b
}

func readI() int {
	sc.Scan()
	r, _ := strconv.Atoi(sc.Text())
	return r
}

func readIs(a int) []int {
	b := make([]int, a)
	for i := 0; i < a; i++ {
		b[i] = readI()
	}
	return b
}

func readF() float64 {
	sc.Scan()
	r, _ := strconv.ParseFloat(sc.Text(), 64)
	return r
}

func readFs(a int) []float64 {
	b := make([]float64, a)
	for i := 0; i < a; i++ {
		b[i] = readF()
	}
	return b
}
//  [ruby]
n=gets.to_i
c=0
while n>=500
  n-=500
  c+=1000
end
while n>=5
  n-=5
  c+=5
end
p c
//  [ruby]
cost = gets.strip.to_i
a = 0
b = 0
while cost/500 !=0 do
  cost -= 500
  a+=1
end

while cost/5 != 0 do
  cost -=5
  b+=1
end

puts a*1000+b*5
//  [ruby]
x = gets.chomp.to_i

i = 0
while true do
	if(x >= 500)
		x = x - 500
		i += 1
	else
		break
	end
end

j = 0
while true do
	if(x >= 5)
		x = x - 5
		j += 1
	else
		break
	end
end

happy = 1000 * i + 5 * j

puts happy
//  [rust]
use std::io::Read;
fn main() {
    let mut buf = String::new();

    std::io::stdin().read_to_string(&mut buf).unwrap();

    let mut iter = buf.split_whitespace();
    let mut x: i32 = iter.next().unwrap().parse().unwrap();
    let mut ans = 0;

    ans += (x / 500) * 1000;
    x %= 500;
    ans += (x / 5) * 5;

    println!("{}", ans);
}
//  [rust]
use proconio::fastout;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;

#[fastout]
fn main() {
    input! {
        x: usize,
    }
    println!("{}", x / 500 * 1000 + (x % 500) / 5 * 5);
}
//  [swift]
import Foundation

let  price = Int(readLine()!)!

let coins500 = price / 500
var remainPrice = price % 500
let coins5 = remainPrice / 5

let hapiness = coins500 * 1000 + coins5 * 5

print(hapiness)
//  [swift]
import Foundation

func readInts() -> [Int]{
    readLine()!.split(separator: " ").map { Int($0)! }
}

func main(){
    let x = Int(readLine()!)!
    print(x / 500 * 1000 + x % 500 / 5 * 5)
}
main()
//  [swift]
import Foundation

let x = Int(readLine()!)!

var happy = 0

happy += x/500 * 1000
happy += (x%500)/5 * 5

print(happy)
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc160 {

    export class ProgramB {
        args: string[];

        constructor(args: string[]) {
            this.args = args;
        }

        /**
         * in
         *1024
         * out
         * 2020
         */
        main(): void {
            let x: number = parseInt(this.args[0], 10);

            let ans :number=0;
            while(x>4) {
                if (x>=500) {
                    ans+=1000;
                    x-=500;
                } else if (x>=5) {
                    ans+=5;
                    x-=5;
                }
            }
            console.log(ans);
        }
    }

}

const args = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n');
const prg = new AtCoder.abc160.ProgramB(args);
prg.main();
//  [typescript]
process.stdin.resume();
process.stdin.setEncoding("utf8");

// 標準入力取込
let gInput = "";
process.stdin.on("data", (chunk) => gInput += chunk);
process.stdin.on("end", () => main(gInput.split(/\r?\n/)));

// 解答
function main(inputs: string[]): void {

    // 整数の数
    const money: number = Number(inputs[0]);

    return console.log((Math.floor(money / 500) * 1000)
                      + (Math.floor((money % 500) / 5) * 5));
}
//  [python]
# coding:utf-8
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
ds = w - v
dd = abs(b - a)

if ds >= 0:
    print('NO')
    exit()
else:
    ans = dd / ds
    if -(ans) <= t:
        print('YES')
        exit()

print('NO')
//  [python]
# -*- coding: utf-8 -*-

a, v = map(int, input().split())
b, w = map(int, input().split())
T = int(input())

k = b - a
flag = False

if k >= 0:
    l = T*v - T*w 
    if (k <= l):
        flag = True

if k < 0:
    k = a - b
    l = T*v - T*w
    if (k <= l):
        flag = True


if (flag == True):
    print('YES')
else:
    print('NO')
//  [python]
A,V=map(int, input().split())
B,W=map(int, input().split())
T=int(input())

AB=abs(A-B)
VW=V-W
if VW == 0:
    print('NO')
elif AB <= VW * T:
    print('YES')
else:
    print('NO')
//  [python]
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

tiji = abs(W-V)
kyori = abs(A-B)

migiiku = False
tukamae = False
if B>A:
    migiiku=True

if W>=V and A!=B:
    print('NO')
elif T*tiji < kyori:
    print('NO')
else:
    for i in range(1,T+1):
        if migiiku:
            A +=V
            B +=W
        else:
            A -= V
            B -= W
        
        if A==B:
            tukamae = True
            break
    
    if tukamae:
        print('YES')
    else:
        print('YES')
//  [python]
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if v<w:
  print("NO")
  exit()
diff=abs(a-b)
for _ in range(t):
  diff=diff-v+w
  if diff<=0:
    print("YES")
    exit()
print("NO")
//  [python]
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import permutations
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7


#############
# Main Code #
#############

A, V = getNM()
B, W = getNM()
T = getN()

dis = abs(A - B)

rang = (V - W) * T


if rang >= dis:
    print('YES')
else:
    print('NO')
//  [java]
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long A = sc.nextLong();
      	long V = sc.nextLong();
      	long B = sc.nextLong();
      	long W = sc.nextLong();
      	long T = sc.nextLong();
        long A1 = A;
      	long B1 = B;
      	int ans = 0;
      	if(A < B) {
      	for(long i = 0;i<T;i++){
          A1 = A1 + V;
          B1 = B1 + W;
          if(A1 >= B1){ ans = 1; break;}
        }
        } else if (A > B) {
        for(long i = 0;i<T;i++){
          A1 = A1 - V;
          B1 = B1 - W;
          if(A1 <= B1){ ans = 1; break;}
        }
        } else {
          ans = 1;
        }
          
        if(ans == 1){
          System.out.println("YES");
        } else {
          System.out.println("NO");
        }
        
    }
}
//  [java]
import java.util.Scanner;


public class Main {


//	final int MOD = 1000000007;

//	public static int min = 3000000;

	public static void main(String[] args) {

		int ans = 0;
		Scanner sc = new Scanner(System.in);
		boolean f = false;

//		long k = sc.nextLong();
//		int n = sc.nextInt();
		long a = sc.nextLong();
		long v = sc.nextLong();
		long b = sc.nextLong();
		long w = sc.nextLong();
		long t = sc.nextLong();

		//-------------------------------------------------------------------------------------
		long tmp = Math.abs(a - b);
		for(long i = 0; i < t; i++) {
			tmp = Math.abs(tmp);

			tmp -= v;
			tmp += w;

//			tmp = Math.abs(tmp);
//			if(tmp + w != 0) {
//				tmp += w;
//			}
//			System.err.println(tmp);

			if(tmp <= 0) {
				f = true;
				break;
			}
		}

		//-------------------------------------------------------------------------------------

		if(f) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

//		System.out.println(ans);

		sc.close();
	}



}
//  [java]

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		idea2();
	}

	// これで提出したら不正解だった…原因は不明
	private static void idea1() {

		// 入力
		Scanner sc = new Scanner(System.in);
		long a = sc.nextInt();
		long v = sc.nextInt();
		long b = sc.nextInt();
		long w = sc.nextInt();
		long t = sc.nextInt();

		// 子Bの逃げる速さが、鬼Aと同速かそれ以上だったら、永遠に追いつけない
		if (v <= w) {
			System.out.println("NO");
			return;
		}

		// ２人の距離は１秒にどれくらい縮まるか？
		long speed = v - w;

		// ２人は最初どのくらい離れているか？
		long dis = (a < b) ? (b - a) : (a - b);

		// 追いつくのに何秒かかるか？
		long need = dis / speed;

		// t秒以内に追いつけたらYES
		System.out.println((need <= t) ? "YES" : "NO");

	}

	private static void idea2() {

		// 入力
		Scanner sc = new Scanner(System.in);
		long a = sc.nextInt();
		long v = sc.nextInt();
		long b = sc.nextInt();
		long w = sc.nextInt();
		long t = sc.nextInt();

		// ２人は最初どのくらい離れているか？
		long dis = (a < b) ? (b - a) : (a - b);

		for (int i = 1; i <= t; i++) {
			// ふたりの距離を更新
			dis = dis - v + w;

			// 追いついたらYES
			if (dis <= 0) {
				System.out.println("YES");
				return;
			}

		}

		System.out.println("NO");

	}

}
//  [cpp]
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>

#define X first
#define Y second
#define PB push_back

using namespace std;

typedef long long ll;
typedef pair < int, int > pii;
typedef vector < int > vi;

const int N = 1e5 + 500;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int LOG = 20;
const int OFF = (1 << LOG);

ll A, B, v, w, T;

int main(){
	scanf("%lld%lld%lld%lld%lld", &A, &v, &B, &w, &T);
	ll dis = (B > A ? B - A : A - B);
	if((v - w) * T >= dis)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;
}
//  [cpp]
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
	long long a=0,v=0,b=0,w=0,t=0;scanf("%lld%lld%lld%lld%lld",&a,&v,&b,&w,&t);
	puts(abs(a-b)<=(v-w)*t?"YES":"NO");
}
//  [cpp]
#include<cstdio>
inline int Abs(int x){return x<0?-x:x;}
int main(){
	int a,b,v,w,t;
	scanf("%d%d%d%d%d",&a,&v,&b,&w,&t);
	puts(v<=w||1ll*(v-w)*t<1ll*Abs(a-b)?"NO":"YES");
	return 0;
}
//  [cpp]
#include <math.h>
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;

int main() {
  
  long long a,w,b,v,n;
  cin >> a >> w >> b >> v >> n;
  bool f = false;
  if(w == v){
    cout << "NO" << endl;
  }else{
    if(a > b){
        f = true;
      }
    for(long long i = 0;i<n;i++){
      if(f == true){
        a = a - w;
        b = b - v;
        if(a <= b){
          cout << "YES" << endl;
          break;
        }
      }else{
        a = a + w;
        b = b + v;
        if(a >= b){
          cout << "YES" << endl;
          break;
        }
      }
      if(i == n - 1){
        cout << "NO" << endl;
      }
    }
  }
}
//  [cpp]
#include <bits/stdc++.h>

using namespace std;

int main() {
  int64_t a, b, v, w, t;
  cin >> a >> v;
  cin >> b >> w;
  cin >> t;
  for(int64_t i = 1; i < t + 1; i++) {
    if(a == b) {
      cout << "YES" << endl;
      return 0;
    }
    if(w >= v) {
      cout << "NO" << endl;
      return 0;
    }
    if(b > a) {
      a += v;
      b += w;
      if(a >= b) {
        cout << "YES" << endl;
        return 0;
      }
    }
    if(a > b) {
      a -= v;
      b -= w;
      if(b >= a) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
//  [cpp]

#include <bits/stdc++.h>
using namespace std;

int main(void){
	long long int a,b,v,w,t;
	int flag=0;
	cin >> a >> v >> b >> w >>t;
	
	for(int i=0; i<t; i++){
		if(a<b){
			if(a+v>=b+w){
			flag=1;
			break;
			}
			a += v;
			b += w;
		}
		else if(a>b){
			if(a-v<=b-w){
				flag=1;
				break;
			}
			a -=v;
			b -=w;
		}
	}
	
		if(a==b||flag==1){
			cout <<"YES" <<endl;
		}else
			cout << "NO" <<endl;
return 0;
}
//  [c]
#include<stdio.h>
#include<stdbool.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#define rep(i,n) for(int i=0; i <(n); i++)
int main(){
  long long a,b,v,w,t,x,y;
  scanf("%lld%lld%lld%lld%lld",&a,&v,&b,&w,&t);
  if(v<=w){
    printf("NO\n");
    return 0;
  }
  x=abs(a-b);
  y=v-w;
  if(x<=t*y){
    printf("YES\n");
    return 0;
  }
  printf("NO\n");
  return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int main() {
	long long a, v, b, w, t;
	scanf("%lld%lld%lld%lld%lld", &a, &v, &b, &w, &t);
	if (a < b) {
		if ((v - w) * t >= b - a)printf("YES");
		else printf("NO");
	}
	else {
		if ((v - w) * t >= a- b)printf("YES");
		else printf("NO");
	}
	return  0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int main(){
 long int a,b,v,w,t;
  scanf("%ld %ld",&a,&v);
  scanf("%ld %ld",&b,&w);
  scanf("%ld",&t);

  int flag=0;
  if(v>w){
    if(abs(a-b)<=(v-w)*t){
    flag=1;
    }
  }

  if(flag==0){
  printf("NO\n");
  }else{
  printf("YES\n");
  }
  return 0;
}
//  [c]
#include<stdio.h>

int main(){
    long i;
    long a, b, v, w, t;
    long s;

    scanf("%ld%ld%ld%ld%ld", &a, &v, &b, &w, &t);

    s = (a > b) ? (a - b):(b - a);

    for(i = 0;i < t;i++){
        s = s + w - v;
        if(s <= 0){
            puts("YES");
            return 0;
        }
    }

    puts("NO");

    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int main(){
  int A,B;
  int V,W;
  int T;
  
  scanf("%d %d\n",&A,&V);
  scanf("%d %d\n",&B,&W);
  scanf("%d",&T);
  
  int c=0;
  if(V>W){
    A-=B;
    if(A<0) A=-A;
    V-=W;
    for(int i=0;i<T;i++){
      A-=V;
      if(A<=0){
        c=1;
        break;
      }
    }
  }
  
  if(c==1) printf("YES\n");
  else printf("NO\n");
  return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>


int main(void){

int a,b,v,w,t;

scanf("%d %d %d %d %d",&a,&v,&b,&w,&t);

int kyori,run;

kyori=abs(b-a);
//run=abs(v*t-w*t);
int flag=0;


if(v>w){
int x;
x=v-w;
for(int i=1;i<=t;i++){
        long int y;
        y=x*i;
        if(y >= kyori){
                flag=1;
                printf("YES\n");
                break;
        }   
}
}

if(flag==0){
        printf("NO\n");
}


return 0;
}
//  [javascript]
function Main(input){
  var tmp =  input.split('\n')[0]
  var A = parseInt(tmp.split(' ')[0]);
  var V = parseInt(tmp.split(' ')[1]);
  
  tmp =  input.split('\n')[1]
  var B = parseInt(tmp.split(' ')[0]);
  var W = parseInt(tmp.split(' ')[1]);
  
  var T = parseInt(input.split('\n')[2]);
  
  // console.log(A, V, B, W, T);
  
  // AとBの距離
  var D = A - B;
  if (D < 0) {
    D = -D;
  }
  
  // D+AがT秒間に逃げる距離をBがT秒間に移動できる距離が大きければBの勝ち
  if ((D + W*T) <= V*T ) {
    console.log('YES');
  } else {
    console.log('NO');
  }
}
 
 
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict';
function Main(stdin){
  const input = stdin.trim().split(/\r?\n/g);
  const A_V= input[0].split(' ').map(str => BigInt(str));
  const A = A_V[0], V = A_V[1];
  const B_W= input[1].split(' ').map(str => BigInt(str));
  const B = B_W[0], W = B_W[1];
  const T = BigInt(input[2]);
  let result = 'NO';
  let kyori;
  const tidimu = V - W;
  
  if(tidimu > 0){
    if(A > 0 && B < 0){
        kyori = A + BigInt(String(B).slice(1));
      } else if(A < 0 && B > 0){
        kyori = B + BigInt(String(A).slice(1));
      } else {
        kyori = A - B;
        if(kyori < 0) kyori = BigInt(String(kyori).slice(1));
      }
      if(tidimu * T >= kyori) result = 'YES';
  }
  console.log(result);
}

// 固定
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";

const main = arg => {
    const inputList = arg.trim().split("\n");
    // 回答を記述
    const A = parseInt(inputList[0].split(" ")[0]);
    const V = parseInt(inputList[0].split(" ")[1]);
    const B = parseInt(inputList[1].split(" ")[0]);
    const W = parseInt(inputList[1].split(" ")[1]);
    const T = parseInt(inputList[2].split(" ")[0]);

    // WがV以上だった場合、追いつけない
    if (V <= W) {
        console.log("NO");
    } else {
        const pointDiff = Math.abs(A - B);
        const speedDiff = V - W;
        if ((pointDiff / speedDiff <= T)) {
            console.log("YES");
        } else {
            console.log("NO");
        }
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
const input = require("fs").readFileSync("/dev/stdin", "utf8")
let cin = input.split(/ |\n/), cid = 0
const next = () => cin[cid++]
const nexts = (n) => cin.slice(cid, cid+=n).map(i=>parseInt(i))

const [A, V, B, W, T] = nexts(5)

const distance = Math.abs(A - B)
if (V <= W) return console.log('NO')
const velocity = V - W
distance / velocity <= T ? console.log('YES') : console.log('NO')
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
 var a = Number(lines[0].split(' ')[0]);
 var v = Number(lines[0].split(' ')[1]);
 var b = Number(lines[1].split(' ')[0]);
 var w = Number(lines[1].split(' ')[1]);
 var t = Number(lines[2]);

 var ichisa = a - b;
 var hayasa = v - w;
 var ans = '';
 
 if(hayasa <= 0){
   ans = 'NO';
 }else{
   if(Math.abs(ichisa) / hayasa <= t){
     ans = "YES";
   }else{
     ans = "NO";
   }   
 }

 console.log(ans);

});
//  [javascript]
'use strict'

function main(input) {
  const [a, b, t] = input
    .trim()
    .split('\n')
    .map((x) => x.split(' ').map((v) => Number(v)))

  const distance = Math.abs(a[0] - b[0])
  const distance2 = (a[1] - b[1]) * t[0]

  console.log(distance <= distance2 ? 'YES' : 'NO')
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [go]
package main

import "fmt"

func main() {
	var a, v, b, w, t int
	fmt.Scan(&a, &v, &b, &w, &t)
	d := abs(a - b)
	x := v - w

	if x <= 0 {
		fmt.Println("NO")
		return
	}

	if (d+x-1)/x <= t {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
//  [go]
package main

import "fmt"

func main() {
	var a,v,b,w,t int64

	fmt.Scan(&a)
	fmt.Scan(&v)
	fmt.Scan(&b)
	fmt.Scan(&w)
	fmt.Scan(&t)
	dist := a - b
	if dist < 0 {
		dist *= -1
	}
	// 最初から追いついていたら速度関係なし
	if (dist == 0) {
		fmt.Print("YES")
	}
	vec := v - w
	// 逃げる速さの方が早いなら追いつけない
	if vec <= 0 {
		fmt.Print("NO")
		return
	}
	if vec * t >= dist {
		fmt.Print("YES")
	} else {
		fmt.Print("NO")
	}
}
//  [go]
package main

import (
	"fmt"
)

func main() {
	var A,V,B,W,T int
	fmt.Scan(&A,&V,&B,&W,&T)
	oituku := V - W
	sum := B - A
	if sum < 0 {
		sum = -sum
	}
	for i:=0; i<T; i++ {
		sum -= oituku
	}
	if sum<=0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func main() {
	sc.Split(bufio.ScanWords)

	A, V := getInt(), getInt()
	B, W := getInt(), getInt()
	T := getInt()

	d := abs(A - B)
	if d == 0 {
		out("YES")
		return
	}
	s := V - W
	if s <= 0 {
		out("NO")
		return
	}
	if d/s == T && d%s != 0 {
		out("NO")
		return
	}
	if d/s > T {
		out("NO")
		return
	}
	out("YES")
}
//  [ruby]
a, v = gets.split.map(&:to_i)
b, w = gets.split.map(&:to_i)
t = gets.to_i
c = (a - b).abs
u = v - w
if t * u >= c
    puts "YES"
else
    puts "NO"
end
//  [ruby]
(A,V),(B,W),(T,_) = $<.map{|ln| ln.split.map(&:to_i) }
puts((V-W)*T<(A-B).abs ? 'NO' : 'YES')
//  [ruby]
lines = []
while line = gets
    lines << line.chomp.split(' ').map(&:to_i)
end

A = lines[0][0]
V = lines[0][1]
B = lines[1][0]
W = lines[1][1]
T = lines[2][0]

if B < A then
  if A - T * V <= B - T * W then
    print "YES"
  else
    print "NO"
  end
elsif A < B then
  if A + T * V >= B + T * W then
    print "YES"
  else
    print "NO"
  end
else
  print "YES"
end
//  [ruby]
require 'bigdecimal'
require 'bigdecimal/util'

A, V = gets.chomp.split(" ").map(&:to_d)
B, W = gets.chomp.split(" ").map(&:to_d)
T = gets.chomp.to_d
d = (A-B).abs
v = (V-W)*T
if (v >= d)
    print "YES"
else
    print "NO"
end
//  [ruby]
require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
a,v = gets.chomp.split.map(&:to_i)
b,w = gets.chomp.split.map(&:to_i)
t = gets.chomp.to_i

if a == b
  puts 'YES'
else
  if (b - a).abs <= t*v - t*w
    puts 'YES'
  else
    puts 'NO'
  end
end
//  [ruby]
require 'bigdecimal'
require 'bigdecimal/util'
a, v = gets.chomp.split(" ").map(&:to_i)
b, w = gets.chomp.split(" ").map(&:to_i)
t = gets.chomp.to_i

if v - w <= 0 || a == b
  puts "NO"
  return
end

if (a - b).abs <= t * (v - w).to_d
  puts "YES"
else
  puts "NO"
end
//  [rust]
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: i64 = read();
    let v: i64 = read();
    let b: i64 = read();
    let w: i64 = read();
    let t: i64 = read();

    let dist = (a - b).abs();
    if (v - w) * t >= dist {
        println!("YES");
    } else {
        println!("NO");
    }
}
//  [rust]
use std::io::{BufRead, Write};

fn main() {
    let stdin = std::io::stdin();
    let stdout = std::io::stdout();
    let mut reader = std::io::BufReader::new(stdin.lock());
    let mut writer = std::io::BufWriter::new(stdout.lock());

    let (a, v): (i64, i64) = {
        let mut buf = String::new();
        reader.read_line(&mut buf).unwrap();
        let mut iter = buf.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    };

    let (b, w): (i64, i64) = {
        let mut buf = String::new();
        reader.read_line(&mut buf).unwrap();
        let mut iter = buf.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    };

    let t: i64 = {
        let mut buf = String::new();
        reader.read_line(&mut buf).unwrap();
        buf.trim_end().parse().unwrap()
    };

    if v <= w {
        writeln!(writer, "NO").unwrap();
    } else {
        if ((a - b).abs() + (v - w) - 1) / (v - w) <= t {
            writeln!(writer, "YES").unwrap();
        } else {
            writeln!(writer, "NO").unwrap();
        }
    }
}
//  [rust]
use std::io::*;
use std::str::FromStr;

//https://qiita.com/tubo28/items/e6076e9040da57368845
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a:i64 = read();
    let v:i64 = read();
    let b:i64 = read();
    let w:i64 = read();
    let t:i64 = read();

    if v - w > 0 {
        let s = (a-b).abs();
        let d = (v-w)*t;
        if s <= d {
            println!("YES");
        }else{
            println!("NO");
        }
    }else{
        println!("NO");
    }

}
//  [rust]
use input::Input;

fn main() {
    let mut input = Input::default();

    let a: i64 = input.parse();
    let v: i64 = input.parse();
    let b: i64 = input.parse();
    let w: i64 = input.parse();
    let t = input.parse();

    let d = (a - b).abs();
    let u = v - w;

    if u > 0 {
        for i in 1..=t {
            if u * i >= d {
                println!("YES");
                return;
            }
        }
        println!("NO");
    } else {
        println!("NO");
    }
}

#[allow(dead_code)]
pub mod input {
    #[derive(Default)]
    pub struct Input(Vec<String>);

    impl Input {
        pub fn read_line(&mut self) -> String {
            let mut s = String::new();
            std::io::stdin().read_line(&mut s).ok().expect("read error");
            s
        }
        pub fn parse<T: std::str::FromStr>(&mut self) -> T {
            let x = if let Some(x) = self.0.pop() {
                x
            } else {
                let s = self.read_line();
                self.0 = s.split_whitespace().map(String::from).rev().collect();
                self.0.pop().expect("reached EOF")
            };
            x.parse().ok().expect("parse error")
        }
    }
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main(){

    input!{
        av: [i64;2],
        bw: [i64;2],
        t: i64,
    }

    let a = av[0];
    let v = av[1];
    let b = bw[0];
    let w = bw[1];

    let mut a_p = a;
    let mut b_p = b;

    let mut ans = "NO";
    for i in 0..t{
        if(a<b){
            a_p += v;
            b_p += w;
            if a_p >= b_p {
                ans = "YES";
                println!("{}", ans);
                return;
            }
        } else {
            a_p -= v;
            b_p -= w;
            if a_p <= b_p {
                ans = "YES";
                println!("{}", ans);
                return;
            } 
        }

    }
    println!("{}", ans);
}