Statistics

Problem Statement for "TheBoringGameDivOne"

Problem Statement

John and Brus are very bored. That's why they decided to invite their friend and play a boring shooter game. John and Brus are on the first team and the friend is the only player of the second team. The game consists of X rounds. During a round players may shoot each other, but a player can't shoot himself. If a player shoots some player from the opposite team his score is increased by one and if he shoots his teammate his score is decreased by one. Once a player is shot, he can't shoot other players and other players can't shoot him until the end of the current round. A round ends when all the players on one of the teams are shot.

You are given six integers. scoreJ, scoreB and scoreF are scores of John, Brus and the friend respectively. killedJ, killedB and killedF are the number of times John, Brus and the friend were shot respectively. Return the int[] containing exactly two elements, where the first element is the smallest possible value of X and the second element is the largest possible value of X. If there are no possible values of X, return an empty int[].

Definition

Class:
TheBoringGameDivOne
Method:
find
Parameters:
int, int, int, int, int, int
Returns:
int[]
Method signature:
int[] find(int scoreJ, int killedJ, int scoreB, int killedB, int scoreF, int killedF)
(be sure your method is public)

Constraints

  • scoreJ will be between -1000 and 1000, inclusive.
  • scoreB will be between -1000 and 1000, inclusive.
  • scoreF will be between -1000 and 1000, inclusive.
  • killedJ will be between 0 and 1000, inclusive.
  • killedB will be between 0 and 1000, inclusive.
  • killedF will be between 0 and 1000, inclusive.

Examples

  1. 1

    1

    1

    1

    2

    2

    Returns: {2, 3 }

    The possible scenario with two rounds is: friend kills John, Brus kills friend, round ends, friend kills Brus, John kills friend, round ends. And with three rounds - John kills friend, round ends, Brus kills friend, round ends, friend kills John, friend kills Brus, round ends.

  2. 0

    0

    0

    0

    0

    0

    Returns: {0, 0 }

    No rounds here.

  3. 4

    7

    -2

    5

    1

    9

    Returns: { }

    This is impossible.

  4. 1

    5

    -1

    4

    3

    6

    Returns: {8, 9 }

  5. -2

    5

    -10

    0

    8

    1

    Returns: { }

  6. -5

    4

    -4

    2

    -3

    1

    Returns: { }

  7. -10

    3

    -10

    3

    -1

    0

    Returns: { }

  8. 45

    40

    -31

    36

    21

    25

    Returns: { }

  9. 25

    35

    -22

    36

    -38

    30

    Returns: { }

  10. -13

    12

    -17

    18

    31

    24

    Returns: { }

  11. -9

    21

    -6

    21

    22

    5

    Returns: {24, 26 }

  12. 24

    23

    23

    24

    47

    47

    Returns: {47, 70 }

  13. 28

    12

    21

    32

    10

    30

    Returns: { }

  14. 28

    44

    -1

    12

    5

    24

    Returns: { }

  15. 38

    32

    1

    0

    46

    2

    Returns: { }

  16. 19

    45

    18

    6

    -2

    18

    Returns: { }

  17. -9

    37

    6

    6

    44

    0

    Returns: { }

  18. -22

    47

    -25

    47

    47

    0

    Returns: {47, 47 }

  19. 37

    4

    10

    15

    7

    39

    Returns: { }

  20. -12

    14

    -14

    44

    -42

    0

    Returns: { }

  21. 9

    16

    -1

    16

    20

    20

    Returns: {26, 36 }

  22. 1

    21

    1

    18

    22

    19

    Returns: {29, 37 }

  23. -1

    25

    -6

    33

    35

    16

    Returns: {37, 41 }

  24. -2

    25

    -8

    20

    22

    13

    Returns: {29, 33 }

  25. -3

    40

    -4

    35

    41

    27

    Returns: {51, 62 }

  26. 4

    14

    10

    15

    18

    25

    Returns: {27, 39 }

  27. 4

    15

    2

    17

    21

    17

    Returns: {25, 32 }

  28. -2

    19

    1

    24

    29

    13

    Returns: {28, 32 }

  29. -6

    34

    12

    25

    40

    25

    Returns: {42, 50 }

  30. 7

    30

    0

    32

    45

    24

    Returns: {43, 54 }

  31. 8

    35

    8

    35

    42

    44

    Returns: {57, 79 }

  32. 8

    36

    8

    37

    44

    45

    Returns: {59, 81 }

  33. 6

    36

    7

    36

    43

    42

    Returns: {57, 78 }

  34. 7

    36

    7

    37

    44

    43

    Returns: {58, 79 }

  35. 6

    39

    7

    38

    45

    45

    Returns: {61, 83 }

  36. 7

    35

    7

    36

    42

    43

    Returns: {57, 78 }

  37. 7

    36

    7

    36

    43

    43

    Returns: {58, 79 }

  38. 7

    36

    8

    35

    43

    43

    Returns: {57, 78 }

  39. 7

    37

    7

    36

    44

    43

    Returns: {58, 79 }

  40. 8

    37

    7

    37

    45

    44

    Returns: {59, 81 }

  41. 0

    24

    -2

    26

    30

    18

    Returns: {34, 42 }

  42. 3

    27

    1

    30

    36

    25

    Returns: {41, 52 }

  43. -3

    23

    0

    25

    27

    18

    Returns: {33, 41 }

  44. 0

    25

    2

    24

    28

    23

    Returns: {36, 47 }

  45. 47

    47

    47

    47

    47

    47

    Returns: { }

  46. -47

    47

    -47

    47

    -47

    47

    Returns: { }

  47. -47

    0

    -47

    0

    -47

    0

    Returns: { }

  48. 500

    500

    500

    500

    1000

    1000

    Returns: {1000, 1500 }

  49. -500

    1000

    -500

    1000

    1000

    0

    Returns: {1000, 1000 }

  50. 0

    500

    0

    500

    0

    1000

    Returns: {1000, 1000 }

  51. 500

    0

    500

    0

    0

    1000

    Returns: {1000, 1000 }

  52. -500

    750

    0

    750

    1000

    0

    Returns: {750, 750 }

  53. 250

    0

    500

    250

    250

    750

    Returns: {750, 750 }

  54. 0

    250

    -250

    750

    250

    500

    Returns: {750, 750 }

  55. 111

    555

    111

    555

    666

    666

    Returns: {888, 1221 }

  56. 59

    496

    189

    306

    370

    680

    Returns: {741, 986 }

  57. 101

    551

    121

    558

    852

    479

    Returns: {794, 1030 }

  58. -41

    555

    4

    373

    555

    336

    Returns: {632, 709 }

  59. 38

    445

    22

    420

    352

    573

    Returns: {719, 925 }

  60. -53

    670

    -14

    565

    681

    487

    Returns: {861, 1052 }

  61. 64

    484

    120

    515

    548

    635

    Returns: {817, 1119 }

  62. 204

    505

    62

    657

    781

    647

    Returns: {905, 1152 }

  63. 288

    249

    -9

    384

    449

    463

    Returns: {548, 712 }

  64. -16

    494

    22

    535

    520

    515

    Returns: {772, 1009 }

  65. 127

    320

    20

    422

    345

    544

    Returns: {643, 864 }

  66. -28

    696

    38

    706

    770

    642

    Returns: {1022, 1338 }

  67. -25

    751

    49

    758

    952

    581

    Returns: {1045, 1332 }

  68. -51

    755

    4

    673

    855

    526

    Returns: {977, 1199 }

  69. -24

    745

    2

    720

    852

    591

    Returns: {1028, 1311 }

  70. -37

    770

    -94

    765

    881

    523

    Returns: {1029, 1288 }

  71. -231

    317

    -275

    490

    -266

    819

    Returns: { }

  72. -619

    541

    -70

    91

    -940

    369

    Returns: { }

  73. 1000

    1000

    1000

    1000

    1000

    1000

    Returns: { }

  74. -1000

    0

    -1000

    0

    -1000

    0

    Returns: { }

  75. 500

    600

    -100

    600

    600

    1000

    Returns: {1100, 1600 }

  76. -400

    1000

    400

    1000

    1000

    1000

    Returns: {1500, 2000 }

  77. 2

    2

    12

    3

    4

    15

    Returns: {15, 17 }

  78. 11

    4

    4

    7

    11

    15

    Returns: {15, 19 }

  79. 5

    13

    -7

    11

    10

    12

    Returns: {19, 22 }

  80. 4

    6

    7

    2

    8

    11

    Returns: {11, 13 }

  81. 15

    12

    5

    8

    20

    20

    Returns: {27, 28 }

  82. 0

    1

    -1

    1

    1

    0

    Returns: {1, 1 }

  83. 1

    1

    -1

    1

    1

    1

    Returns: {2, 2 }

  84. 1

    1

    -1

    2

    2

    1

    Returns: {2, 2 }

  85. 0

    1

    0

    3

    1

    3

    Returns: {4, 4 }

  86. -1

    1

    0

    1

    1

    0

    Returns: {1, 1 }

  87. -5

    6

    2

    6

    6

    3

    Returns: {8, 9 }

  88. -1

    3

    -2

    4

    3

    1

    Returns: {4, 4 }

  89. 1

    1

    0

    0

    1

    1

    Returns: { }

  90. 0

    1

    0

    1

    1

    1

    Returns: {2, 2 }

  91. -8

    11

    1

    13

    13

    4

    Returns: {14, 15 }


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: