fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int x,y,z,ax,bx,cx,ay,by,cy,az,bz,cz;
  5. scanf("%d \n",&x);
  6. scanf("%d %d %d \n",&ax,&bx,&cx);
  7. scanf("%d \n",&y);
  8. scanf("%d %d %d \n",&ay,&by,&cy);
  9. scanf("%d \n",&z);
  10. scanf("%d %d %d \n",&az,&bz,&cz);
  11. int la,lb,lc,ga,gb,gc;
  12. ga=(ay*y+az*z)/100; gb=(bx*x+bz*z)/100; gc=(cx*x+cy*y)/100;
  13. la=x-ga; lb=y-gb; lc=z-gc;
  14. if(la>0 && lb>0 && lc>0)
  15. {
  16. if(la>lb && la>lc)
  17. printf("A");
  18. else if(lb>lc && lb>la)
  19. printf("b");
  20. else if(lc>la && lc>lb)
  21. printf("C");
  22. }
  23. else if(la>0 && lb>0 && lc<0)
  24. {
  25. if(la>lb)
  26. printf("A");
  27. else
  28. printf("B");
  29. }
  30. else if(la>0 && lb<0 && lc>0)
  31. {
  32. if(la>lc)
  33. printf("A");
  34. else
  35. printf("C");
  36. }
  37. else if(la<0 && lb>0 && lc>0)
  38. {
  39. if(lb>lc)
  40. printf("B");
  41. else
  42. printf("C");
  43. }
  44. else if(la<0 && lb<0 && lc>0)
  45. {
  46. printf("C");
  47. }
  48. else if(la<0 && lb>0 && lc<0)
  49. {
  50. printf("B");
  51. }
  52. else if(la>0 && lb<0 && lc<0)
  53. {
  54. printf("A");
  55. }
  56. if(la<0 && lb<0 && lc<0)
  57. {
  58. if(la>lb && la>lc)
  59. printf("A");
  60. else if(lb>lc && lb>la)
  61. printf("b");
  62. else if(lc>la && lc>lb)
  63. printf("C");
  64. }
  65.  
  66. return 0;
  67. }
  68.  
  69.  
  70.  
  71.  
Success #stdin #stdout 0s 4248KB
stdin
5000 
50 25 25
2000
20 40 40
4000
10 50 40
stdout
A