Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. int y1, y2, y3, y4, y5;
  2.  
  3. int furious_zob(int x1, int x2, int x3) {
  4. int foo;
  5. if (x1 < 0 || x2 < 0 || x3 < 0) {
  6. return 0;
  7. }
  8. try {
  9. if ((x1 + x2 + x3) % 3 == 0) {
  10. y1++;
  11. foo = furious_zob(x1 - ((7*x1 + 3*x2 + 5*x3)%2) - 1, x2 + 2, x3);
  12. if ((9 * foo) % 5 >= 2) {
  13. throw Zob1(0);
  14. }
  15. }
  16. if ((x1 + x2 + x3) % 3 == 1) {
  17. y2++;
  18. foo = furious_zob(x1, x2 - ((7*x1 + 3*x2 + 5*x3)%2) - 1, x3 + 1);
  19. if ((5 * foo) % 7 >= 3) {
  20. throw Zob2(1);
  21. }
  22. }
  23. if ((x1 + x2 + x3) % 3 == 2) {
  24. y3++;
  25. foo = furious_zob(x1, x2, x3 - ((7*x1 + 3*x2 + 5*x3)%2) - 1);
  26. if ((4 * foo) % 3 == 2) {
  27. throw Zob3(2);
  28. }
  29. }
  30. }
  31. catch (Zob1 x) {
  32. if ((2*x1 + x2 + x3) % 3 == 0) {
  33. y4++;
  34. foo = furious_zob(x1 - 1, x2 + ((7*x1 + 3*x2 + 5*x3)%2) - 1, x3);
  35. if ((9 * foo) % 5 >= 2) {
  36. return ++y5;
  37. }
  38. else {
  39. return x1+x2;
  40. }
  41. }
  42. }
  43. catch (Zob2 x) {
  44. if ((2*x1 + x2 + x3) % 3 == 0) {
  45. y2++;
  46. foo = furious_zob(x1 - ((7*x1 + 3*x2 + 5*x3)%2) - 1, x2 + 2, x3 - 1);
  47. if ((13 * foo) % 7 >= 3) {
  48. return ++y4;
  49. }
  50. else {
  51. return 7*x1-x2+2*x3;
  52. }
  53. }
  54. }
  55. catch (Zob3 x) {
  56. if ((2*x1 + x2 + x3) % 3 == 0) {
  57. y2++;
  58. foo = furious_zob(x1 - 2, x2 + ((7*x1 + 3*x2 + 5*x3)%2) - 1, x3 - 1);
  59. if ((13 * foo) % 7 >= 3) {
  60. return ++y4;
  61. }
  62. else {
  63. return 7*x1-x2+2*x3;
  64. }
  65. }
  66. }
  67. return 42;
  68. }
  69.  
  70. int main(int argc, char **argv) {
  71. int a,b,c;
  72. a = atoi(argv[1]);
  73. b = atoi(argv[2]);
  74. c = atoi(argv[3]);
  75. try {
  76. furious_zob(a,b,c);
  77. }
  78. finally {
  79. printf("y1 : %d\ny2 : %d\ny3 : %d\ny4 : %d\ny5 : %d\n", y1, y2, y3, y4, y5);
  80. }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement