Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. typedef struct {
  5. int width, ratio, diameter;
  6. } tire;
  7.  
  8. tire spec, vasya;
  9.  
  10. int main(){
  11. int k;
  12. freopen("input.txt", "r", stdin);
  13. freopen("output.txt", "w", stdout);
  14. scanf("%d", &k);
  15. scanf("%d/%dR%d", &spec.width, &spec.ratio, &spec.diameter);
  16. scanf("%d/%dR%d", &vasya.width, &vasya.ratio, &vasya.diameter);
  17. int r1 = spec.width * spec.ratio + spec.diameter * 1270;
  18. int r2 = vasya.width * vasya.ratio + vasya.diameter * 1270;
  19. if(abs(r1 - r2) * 100 <= k * r1) {
  20. printf("APPROVED");
  21. } else {
  22. printf("DISAPPROVED");
  23. }
  24. fclose(stdin);
  25. fclose(stdout);
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement