import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int v1 = sc.nextInt();
int v2 = sc.nextInt();
int t = sc.nextInt();
int s = sc.nextInt();
int l = sc.nextInt();
int s1 = 0, s2 = 0, time = 0;
while(s1 < l && s2 < l){
if((s1-s2) >= t){
for (int i = 0; i < s; i++){
s2 += v2;
time++;
if(s2 == l)
break;
}
} else {
time++;
s1 += v1;
s2 += v2;
}
}
if(s1 == l && s2 < l){
System.out.print("R\n" + time);
} else if(s1 < l && s2 == l){
System.out.print("T\n" + time);
} else {
System.out.print("D\n" + time);
}
}
}
基础练习 龟兔赛跑预测
最新推荐文章于 2022-04-06 18:44:54 发布