Guest User

PROBSUB Solution

a guest
Sep 18th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import java.io.BufferedReader;
  2. import java.io.InputStreamReader;
  3.  
  4. public class Main {
  5.  
  6. public static void main(String[] args) throws Exception {
  7. BufferedReader r =new BufferedReader(new InputStreamReader(System.in));
  8.  
  9.  
  10. long t=Long.parseLong(r.readLine());
  11. while(t-->0)
  12. {
  13. String[] value=r.readLine().split(" ");
  14. double gold=Integer.parseInt(value[0]);
  15. double diamond=Integer.parseInt(value[1]);
  16. double coal=Integer.parseInt(value[2]);
  17.  
  18. double total=gold+diamond+coal;
  19. if(total!=0){
  20. double diamondChance=100*(diamond/total);
  21.  
  22.  
  23. if(diamondChance>50)
  24. {System.out.println("Yes");}
  25. else
  26. {System.out.println("No");}
  27.  
  28. }
  29. else
  30. {System.out.println("No");}
  31. }
  32. }
  33.  
  34. }
Add Comment
Please, Sign In to add comment