fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. long long x;
  6. int y;
  7. cin >> x >> y;
  8.  
  9. long long thuNhap = x * 1000000LL;
  10. long long giamTru = 11000000LL + 4400000LL * y;
  11. long long tntt = thuNhap - giamTru;
  12.  
  13. if (tntt <= 0) {
  14. cout << "1 0\n";
  15. return 0;
  16. }
  17.  
  18.  
  19. long long thue = 0;
  20. long long tntt_copy = tntt;
  21.  
  22. if (tntt_copy > 80000000) {
  23. thue += (tntt_copy - 80000000) * 35 / 100;
  24. tntt_copy = 80000000;
  25. }
  26. if (tntt_copy > 52000000) {
  27. thue += (tntt_copy - 52000000) * 30 / 100;
  28. tntt_copy = 52000000;
  29. }
  30. if (tntt_copy > 32000000) {
  31. thue += (tntt_copy - 32000000) * 25 / 100;
  32. tntt_copy = 32000000;
  33. }
  34. if (tntt_copy > 18000000) {
  35. thue += (tntt_copy - 18000000) * 20 / 100;
  36. tntt_copy = 18000000;
  37. }
  38. if (tntt_copy > 10000000) {
  39. thue += (tntt_copy - 10000000) * 15 / 100;
  40. tntt_copy = 10000000;
  41. }
  42. if (tntt_copy > 5000000) {
  43. thue += (tntt_copy - 5000000) * 10 / 100;
  44. tntt_copy = 5000000;
  45. }
  46. if (tntt_copy > 0) {
  47. thue += tntt_copy * 5 / 100;
  48. }
  49.  
  50.  
  51. int bac;
  52. if (tntt <= 5000000) bac = 1;
  53. else if (tntt <= 10000000) bac = 2;
  54. else if (tntt <= 18000000) bac = 3;
  55. else if (tntt <= 32000000) bac = 4;
  56. else if (tntt <= 52000000) bac = 5;
  57. else if (tntt <= 80000000) bac = 6;
  58. else bac = 7;
  59.  
  60. cout << bac << " " << thue << "\n";
  61. return 0;
  62. }
Success #stdin #stdout 0.01s 5276KB
stdin
11 0
20 1
50 2
stdout
1 0