fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5. int d = 0, vf = 0, vg = 0;
  6. float distancia = 0, tf = 0, tg = 0;
  7.  
  8. while(scanf("%i %i %i", &d, &vf, &vg) != EOF) {
  9. distancia = sqrt(144 + pow(d,2)); //144 = 12^2
  10. tf = 12.0 / vf;
  11. tg = distancia / vg;
  12.  
  13. if (tf >= tg)
  14. printf("S");
  15. else
  16. printf("N");
  17.  
  18. printf("\n"); //na maratona, muitas vezes eh necessário terminar com uma nova linha
  19. }
  20.  
  21. return 0;
  22. }
  23.  
  24.  
  25.  
Success #stdin #stdout 0s 9416KB
stdin
5 1 12
12 10 7
12 9 10
10 5 5
9 12 15
stdout
S
N
N
N
S