- Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathDragon.java
26 lines (24 loc) · 716 Bytes
/
Dragon.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//problem: https://codeforces.com/problemset/problem/1337/B
importjava.util.Scanner;
publicclassDragon{
publicstaticvoidmain(String[] args){
ScannersObj = newScanner(System.in);
intnos = sObj.nextInt();
for(inti=0; i<nos; i++){
inthp = sObj.nextInt();
inthalfSpell = sObj.nextInt();
intlightning = sObj.nextInt();
while(hp>20 && halfSpell > 0){
hp = hp/2 + 10;
halfSpell--;
}
hp -= lightning*10;
if(hp <= 0){
System.out.println("Yes");
}
else{
System.out.println("No");
}
}
}
}