Statistics

Problem Statement for "ShufflingMachine"

Problem Statement

A card shuffling machine is a device designed to randomize the order of a deck of cards. A particularly poor (but unfortunately relatively common) design of machine works as follows: an integer N is selected uniformly at random between 1 and maxShuffles, inclusive, and a series of N exactly similar deterministic shuffles are performed. A deterministic shuffle is a fixed permutation of the cards. The randomness of the resulting ordering is clearly therefore only dependent on the number of shuffles chosen. After the deck has been shuffled N times, the cards are distributed to the players.

A particularly dishonest player has decided that he wishes to cheat. He has identified K cards in the deck that he wants to receive when the cards are distributed. He has managed to figure out both the fixed shuffle that the machine uses and also the maximum number of shuffles chosen. The fixed shuffle is given in a int[] shuffle, in which element i gives the position after the shuffle of the card that was initially in position i (both 0-based). The positions in the deck of the cards the player will receive after they have been shuffled are given in cardsReceived (0-based). Before the cards are shuffled, the player can order them in any way he wishes. Determine the initial ordering that will maximize the expected number of the K desired cards that he will receive and return this expected number.

Definition

Class:
ShufflingMachine
Method:
stackDeck
Parameters:
int[], int, int[], int
Returns:
double
Method signature:
double stackDeck(int[] shuffle, int maxShuffles, int[] cardsReceived, int K)
(be sure your method is public)

Notes

  • Your return value must be accurate to an absolute or relative tolerance of 1e-9.

Constraints

  • shuffle will contain between 1 and 50 elements, inclusive.
  • shuffle will be a permutation of the numbers between 0 and M-1, inclusive, where M is the number of elements in shuffle.
  • maxShuffles will be between 1 and 100, inclusive.
  • cardsReceived will contain between 1 and M elements, inclusive.
  • Each element of cardsReceived will be between 0 and M-1.
  • The elements of cardsReceived will be distinct.
  • K will be between 1 and M, inclusive.

Examples

  1. {1,0}

    3

    {0}

    1

    Returns: 0.6666666666666666

    This deck contains only 2 cards and they swap positions after each shuffle. The cheating player receives first card in the deck after the shuffling is completed and he wants to receive 1 of the cards in the deck. If the deck is shuffled 1 or 3 times, he will receive the card that was initially in position 1. If the deck is shuffled 2 times, he will receive the card in position 0. It is therefore optimal to put the card that he wants in position 1 and he will receive it 2 times out of 3.

  2. {1,2,0}

    5

    {0}

    2

    Returns: 0.8

    If he puts the cards he wants in positions 1 and 2, he will receive one of them 4 times out of 5.

  3. {1,2,0,4,3}

    7

    {0,3}

    2

    Returns: 1.0

    If he puts the cards in positions 3 and 4, he will receive exactly one of them, regardless of how many shuffles are chosen.

  4. {0,4,3,5,2,6,1}

    19

    {1,3,5}

    2

    Returns: 1.0526315789473684

  5. {6,5,7,2,0,9,8,1,4,3}

    90

    {8,2,7}

    4

    Returns: 1.3333333333333333

  6. {3,4,7,2,8,5,6,1,0,9}

    47

    {6,3,5,2,8,7,4}

    8

    Returns: 6.297872340425532

  7. {1,0,6,4,5,2,8,7,3,9}

    80

    {1,9,5,6,7,0,3,8,2,4}

    7

    Returns: 7.0

  8. {7,2,9,3,1,8,6,5,4,0}

    96

    {6,9}

    7

    Returns: 1.75

  9. {6,1,5,7,2,3,4,8,9,0}

    12

    {9,8,2,3}

    1

    Returns: 0.5

  10. {2,5,6,7,0,3,9,8,1,4}

    7

    {2,3,7,5}

    5

    Returns: 3.0

  11. {6,9,7,3,1,8,2,5,4,0}

    20

    {0,2,8,4}

    8

    Returns: 3.6

  12. {6,8,5,2,7,9,3,4,0,1}

    3

    {2,8,6,7,9}

    8

    Returns: 4.333333333333333

  13. {1,5,2,3,7,4,8,0,6,9}

    73

    {8,3,4,2,0,9,1}

    5

    Returns: 4.205479452054795

  14. {1,4,3,0,8,5,2,7,6,9}

    60

    {2,8,1,4,0,3,9,5}

    8

    Returns: 7.15

  15. {17,35,4,8,47,9,33,13,5,0,31,7,28,15,10,2,18,34,32,48,21,19,26,24,23,6,37,46,20,3,38,39,11,44,14,27,25,22,45,12,43,1,30,41,29,42,40,16,49,36}

    99

    {37,43,40,9,16,17,15,6,34,0,1,19,38,33,28,36,7}

    46

    Returns: 16.505050505050505

  16. {2,30,33,37,41,24,34,15,10,5,9,43,0,8,28,13,47,7,46,42,40,29,16,1,3,14,39,31,45,36,32,49,6,35,44,25,27,48,17,22,12,18,20,38,21,19,4,26,23,11}

    54

    {18,37,5,1,46}

    9

    Returns: 2.5555555555555554

  17. {43,49,12,44,11,5,30,34,1,36,13,31,23,10,25,47,28,29,21,27,16,19,2,20,41,18,7,35,45,48,40,6,42,4,24,0,17,9,14,22,26,46,38,3,15,37,32,33,8,39}

    15

    {29,11,27,40,2,20,9,6,14,22,39,10,0,24,41,36,42,31,26,43,21,3,19,48,34,13,46,37}

    6

    Returns: 4.733333333333333

  18. {10,47,22,29,1,30,28,11,39,14,41,32,9,33,40,35,21,5,27,3,18,48,49,24,19,36,25,0,12,42,13,8,31,17,26,34,43,2,20,46,37,15,45,7,44,23,4,16,6,38}

    100

    {19,41,36,6,1,2,17,45,31,30,46,8,13,16,23,29,38,24,44,37,12,43,42,47,7,5,10,26,25,33,20,32}

    33

    Returns: 23.04

  19. {38,42,6,19,14,22,23,27,47,10,45,30,41,20,16,33,34,25,0,48,4,13,49,37,35,15,21,5,2,17,18,28,24,1,39,44,8,40,46,32,12,9,11,36,43,31,7,26,29,3}

    49

    {17,44,7,37,19,43}

    16

    Returns: 2.3877551020408165

  20. {22,41,27,35,28,49,32,33,15,31,19,18,12,23,2,42,0,14,46,29,43,45,44,10,36,30,8,16,6,47,4,9,39,48,1,40,37,7,24,25,5,13,26,21,34,20,38,3,11,17}

    7

    {46,17,0,25,13,5,38,23,11,15,3,26,44,45,1,32,35,18,14,49,12,47,28,8,4,36,2,39,29,7,21,24,30,33,22,41,42,6,20,48,16}

    43

    Returns: 37.714285714285715

  21. {37,2,34,23,44,10,21,8,48,4,6,45,11,25,19,46,36,27,39,26,33,22,35,42,13,43,31,0,12,14,49,17,24,28,9,20,41,16,1,32,7,47,30,18,15,3,5,40,38,29}

    1

    {14,45,15,43,29,3,9,25,46,47,44,2,48,33,30,8,21,39,6,17,28,11,37,1,49,12,32,19,34,38,23,16,18,5,41,42,22,26}

    31

    Returns: 31.0

  22. {29,7,25,0,47,17,41,13,14,10,39,16,43,49,8,11,9,35,38,5,18,45,30,22,28,15,2,19,37,36,34,27,4,40,46,6,3,48,23,31,20,42,12,33,26,1,24,21,44,32}

    98

    {10,16,0,24}

    38

    Returns: 3.9285714285714284

  23. {32,1,10,28,14,6,39,47,38,22,11,46,43,2,12,26,13,30,16,4,31,8,24,9,48,42,35,7,49,33,5,18,23,27,29,44,37,40,20,19,0,45,15,3,34,21,41,17,25,36}

    65

    {11,41,7,9,0,5,27,17,49,10,13,32,1,45,14,19,23,44,24,38,15,2,36,37,4,42,33,8,40,28,48}

    48

    Returns: 29.892307692307693

  24. {39,12,21,34,35,20,31,19,16,27,8,7,26,40,23,18,36,14,13,25,6,41,49,33,15,24,30,29,11,37,42,47,32,5,22,45,3,38,28,44,10,2,48,1,17,0,4,9,46,43}

    83

    {4,43,36}

    39

    Returns: 2.63855421686747

  25. {37,11,16,9,14,6,24,28,31,26,17,46,20,38,0,12,21,35,13,29,22,41,23,5,1,4,8,45,18,15,49,32,30,3,44,10,33,48,27,7,36,40,25,39,2,43,19,47,34,42}

    47

    {38,14,28,42,49,5,23,17,32,13,35,1,18}

    47

    Returns: 12.702127659574469

  26. {14,38,30,25,20,33,26,22,13,47,39,41,1,24,15,23,36,7,6,35,9,8,43,3,28,17,32,5,29,0,27,16,18,2,44,45,42,48,4,49,34,31,46,37,12,21,19,11,10,40}

    85

    {25,34,15,35,19,28,13,40,26,33,45,10,16,18,47}

    39

    Returns: 12.305882352941177

  27. {21,29,0,44,38,23,5,19,22,47,37,25,12,27,9,43,41,28,17,26,32,8,4,36,15,49,3,14,45,7,24,40,18,48,33,10,13,6,16,31,34,46,1,20,39,2,42,30,35,11}

    66

    {47,15,16,28,19,40,33,2,14,7,45,22,13,39,37,29,12,23,25,27,42,20,43,6,48,0,3,36,10,9,1,44,35,11,49,46,8,31,21,4,30,18,17,24,38,26,41,34,32}

    46

    Returns: 45.121212121212125

  28. {8,36,21,5,32,40,29,9,17,33,35,3,27,37,24,22,46,38,19,16,23,4,49,11,13,7,42,48,15,30,10,6,47,25,43,20,31,0,14,41,39,28,1,34,2,18,26,44,12,45}

    18

    {6,36,1,25,12,43,38}

    32

    Returns: 6.5

  29. {38,10,47,21,24,44,20,36,30,23,16,45,43,40,46,3,41,48,1,27,34,25,28,33,8,18,12,49,7,31,32,35,19,17,22,37,15,0,2,39,13,6,14,42,11,26,9,4,5,29}

    56

    {20,35,49,5,42,33,23,44,30,21}

    24

    Returns: 6.767857142857143

  30. {42,17,28,19,35,40,48,30,4,7,41,3,22,25,31,20,16,23,46,10,39,32,8,18,15,47,12,38,9,49,6,5,2,34,37,26,14,33,24,1,36,43,29,27,45,21,44,0,11,13}

    76

    {47,29,6,30,38,1,35,14,28,32}

    37

    Returns: 8.43421052631579

  31. {14,11,23,45,13,25,29,19,27,5,37,38,26,33,39,12,40,22,2,47,9,7,36,8,46,30,31,6,4,24,35,10,42,28,18,0,1,16,34,44,3,32,20,21,43,15,17,49,41,48}

    41

    {40,4,26,24,43,38,14,31,12,5,11,48,9,37,25,47,7,19,34,32,33,39,46,2,27,29,17,10,22,41,44,42,28,21,8,0,13,35,23,18,3,15,49,16,30,45,1}

    16

    Returns: 15.902439024390244

  32. {38,22,10,15,41,24,1,23,45,19,43,21,12,17,27,25,32,42,49,29,44,39,31,11,37,14,0,40,46,5,34,48,4,28,6,18,13,16,9,35,7,33,8,30,47,26,2,3,36,20}

    31

    {27,33,34,46,23,18,37,21,30,6,47,48,7,19,24,36,13,20,10,25,8,12,5,16,42,32,40,41,49,31,11,45,39,28,0,26,35,1,4,3,29,38,43,15,17}

    20

    Returns: 18.258064516129032

  33. {42,11,32,20,16,10,45,13,21,44,8,1,23,31,43,22,47,9,38,41,19,33,18,37,30,5,35,14,46,4,2,49,26,34,40,0,24,27,17,48,25,7,28,29,6,36,3,39,15,12}

    3

    {22,9,41,3,47,49,8,4,7,20}

    33

    Returns: 10.0

  34. {25,13,24,31,43,16,0,33,38,11,7,40,48,3,14,18,44,41,15,22,47,49,30,29,39,2,42,20,5,10,46,27,19,4,1,32,12,17,9,8,26,21,6,45,36,23,35,37,28,34}

    20

    {6,41,46,18,38}

    32

    Returns: 4.9

  35. {20,16,34,12,8,48,29,28,44,6,30,17,15,22,24,2,40,38,32,45,35,42,33,9,1,19,23,26,4,43,27,37,11,41,25,0,14,10,7,3,46,21,13,49,5,39,36,31,18,47}

    96

    {49,14,21,45,7,48,42,22,1,41,3,16,20,10,8,34,39,25,27,31,12,43,38,23,35,44,46,11,40,30,26,28,5,13,0,4}

    33

    Returns: 25.354166666666668

  36. {45,3,20,6,32,47,19,11,28,38,27,5,4,49,23,44,15,29,24,34,39,13,25,30,41,33,46,35,1,31,9,10,40,43,7,16,12,42,8,2,0,37,14,36,48,17,18,26,21,22}

    84

    {32,48,40,22,13,25}

    39

    Returns: 6.0

  37. {16,23,41,46,27,36,42,12,38,20,1,14,21,35,0,3,15,31,39,8,2,19,33,43,26,34,30,40,17,28,5,11,6,13,32,49,10,22,44,29,37,47,48,7,25,45,9,24,18,4}

    25

    {26,7,22,27,39,33,25,49,21,34,9,14,16,48,29,10,0,19,32,13,5,30,3,47,35,43,36,42,2,44,23,37,28,6,40,18,24,12,31}

    50

    Returns: 39.0

  38. {3,38,1,32,35,19,45,21,48,33,29,17,5,20,43,13,49,6,23,30,7,46,9,26,27,18,12,0,44,25,28,39,47,14,36,11,24,8,16,15,42,10,4,40,41,31,37,2,22,34}

    19

    {27,3,28,15,48,12,37,33,7,13,11,34,24,26,25,14,4,0,20,47,17,49,16,36,40,2,21,10,35,9,31,8,42,6,46,1}

    29

    Returns: 24.68421052631579

  39. {17,35,49,38,43,1,42,0,48,3,25,36,9,18,32,2,39,23,37,14,24,13,16,47,6,22,12,44,34,15,11,5,21,41,27,4,7,26,8,33,45,10,28,19,46,31,30,20,29,40}

    40

    {6,14,36,32,42,18,40,38,2,5,41,7,10,34,3,33,48,11,20,17,31,26,37}

    15

    Returns: 7.275

  40. {28,45,7,23,44,10,3,30,47,19,46,41,21,40,36,38,17,32,35,27,48,20,16,39,29,24,37,33,12,6,11,25,1,0,22,26,18,34,5,4,42,15,9,31,43,2,13,14,8,49}

    12

    {35,32,42,5,49,27,39,17,29,3,41,14,20,21,44}

    13

    Returns: 5.333333333333333

  41. {11,47,16,29,26,40,9,33,35,46,14,38,39,21,48,23,37,43,15,31,2,8,44,6,18,49,0,30,13,22,42,34,7,45,19,41,1,28,3,24,17,5,32,27,20,25,12,4,36,10}

    84

    {41,8,39,42,14,19,44,20,4,46,24,17,10,2,3,15,13,49,23,31,36,38,16,1,34,32,48,6,11}

    16

    Returns: 11.202380952380953

  42. {1,25,17,8,39,26,6,28,46,31,19,20,15,16,9,21,34,24,47,4,3,29,40,7,38,41,48,45,42,37,14,32,36,22,13,11,44,10,27,23,0,43,49,33,12,18,2,35,5,30}

    90

    {15,45,39,44,4,30,40,27,25,17,49,23,20,8,48,10,11,34,22,3,38,41,0,36,29,28,33,21,26,46,19,2,6,42,13,14,18,47,43,31,12,16,37,7}

    33

    Returns: 30.0

  43. {46,37,26,16,6,15,31,47,3,9,42,43,10,35,11,32,2,38,48,44,41,4,28,49,18,33,25,8,23,39,7,21,13,27,5,22,30,19,14,29,34,45,12,20,0,24,40,17,36,1}

    5

    {6,33,2,23,18,11,41,0,43,20,10,44,4,12,25}

    14

    Returns: 8.6

  44. {5,2,44,22,29,24,34,18,26,45,20,14,10,19,36,47,11,27,0,13,23,8,7,1,25,42,37,39,16,6,21,41,28,17,40,15,30,31,38,32,12,48,43,4,3,35,33,9,49,46}

    20

    {3,32,35,37}

    22

    Returns: 2.7

  45. {43,14,25,0,9,1,36,40,31,5,28,35,3,20,44,11,8,46,10,2,49,4,29,39,18,24,45,7,17,30,37,34,16,19,48,27,38,12,47,23,33,41,22,13,21,15,6,26,32,42}

    87

    {6,44,8,29,3,31,14,20,18,28,35,17,11,30,9,22,49,7,10,39,41}

    11

    Returns: 6.0344827586206895

  46. {49,27,22,20,44,13,42,2,16,36,47,5,12,3,39,32,11,48,45,21,4,8,25,1,41,30,24,23,26,6,17,43,28,7,19,33,9,46,38,10,37,31,15,14,34,0,18,40,29,35}

    79

    {31,5,22,35,2,30,14,1,24,44,13,33,25,32,23,46,8,0,7,38,43,34,39,37,45,49,19,20,9,41,48}

    4

    Returns: 3.0126582278481013

  47. {34,41,20,0,31,10,26,7,28,1,39,40,33,38,42,30,32,48,5,43,47,16,44,15,27,23,19,45,4,9,37,13,22,17,2,49,24,29,8,36,6,11,12,35,21,25,46,18,14,3}

    15

    {23,7,8,5,28,15,25,45,19,48,31,0,36,9,40,27,24,33,39,2,6,46,13,11,47,20}

    9

    Returns: 7.2

  48. {40,46,5,45,12,26,29,9,17,20,10,32,36,31,0,35,11,38,24,37,1,34,15,4,47,41,22,27,3,21,28,49,30,18,16,44,8,6,7,39,33,23,2,25,42,43,48,14,19,13}

    22

    {41,13,0,25,7,36,11,15,38,22,46}

    28

    Returns: 7.636363636363637

  49. {38,43,13,31,47,9,2,20,8,11,29,3,27,37,30,49,7,14,35,28,15,34,23,32,18,19,45,24,26,6,12,25,42,0,44,16,39,17,22,21,46,4,41,33,5,1,10,40,48,36}

    67

    {15,48,8,44,0,33,10,36,22,35,17,26,11,28,32,6,31,13,2,18,29,41,23,7,14,24,4,3}

    26

    Returns: 15.447761194029852

  50. {44,12,26,47,30,5,43,48,4,35,34,17,45,23,37,16,1,0,28,3,46,15,10,24,29,31,7,13,14,9,42,40,27,8,18,41,22,39,21,6,38,32,36,20,49,33,25,2,19,11}

    36

    {8,3,25,38,36,46,41,18,17,2,47,26,10,45,11,34,4,32,0,30,35,24,28,13,39,27,37,20,16,31,5}

    38

    Returns: 24.194444444444443

  51. {17,12,31,44,0,37,29,42,47,2,11,34,3,22,35,15,6,39,38,36,21,14,10,45,23,18,13,7,41,27,43,40,4,32,5,48,24,25,46,30,16,8,49,20,28,9,19,1,33,26}

    36

    {24,36,22,28,16,7,35,11,15,23,21,25,9,41,29,5,2,13,4,34,20,0,38,30,33,14,40,32,6,39,47,12,27,44}

    42

    Returns: 29.11111111111111

  52. {24,25,28,4,18,29,48,5,3,13,33,22,2,49,11,34,46,7,16,1,45,47,19,40,12,32,14,43,10,6,35,17,9,20,38,0,31,26,41,44,30,37,21,8,27,15,23,36,39,42}

    49

    {37,40,44,3,35,38,30,23,43,21,13,27,33,16,41,17,24,28,49}

    33

    Returns: 12.755102040816327

  53. {1,10,36,30,48,3,31,47,15,12,6,49,23,38,16,14,35,42,44,18,4,11,9,7,33,17,8,0,22,19,2,28,41,45,43,5,25,32,37,26,20,39,29,27,21,13,24,40,46,34}

    13

    {18,36,37,24,1,35,29,0,3,15,40,25,45,17,11,5,39,21,22,41,13,28,4,10,27,9,42,49,12,31,20,47,8,33,2,19,30,32,48,7,34,38,14,43,44}

    15

    Returns: 14.615384615384615

  54. {16,7,4,9,1,26,11,20,6,44,8,39,48,45,36,14,32,43,34,25,24,30,41,29,38,40,49,22,5,18,23,19,37,35,31,42,21,12,17,3,33,0,15,2,27,28,13,46,10,47}

    82

    {23,49,47,18,2,39,20,44,13,37,27,48,36,38,11,9,3,35,8,46,32,43,29,41,21,33,7,15,25,6,45}

    49

    Returns: 30.451219512195124

  55. {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,0}

    100

    {1,2,3}

    5

    Returns: 0.3

  56. {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,0}

    77

    {1,3,8,2,44}

    3

    Returns: 0.38961038961038963

  57. {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,0}

    7

    {1,5,3,45,46,33,35,36,37,49,8}

    2

    Returns: 1.1428571428571428

  58. {0, 4, 3, 5, 2, 6, 1 }

    19

    {1, 3, 5 }

    2

    Returns: 1.0526315789473684

  59. {12, 1, 9, 49, 0, 27, 36, 31, 29, 45, 18, 46, 32, 40, 23, 33, 26, 41, 48, 17, 8, 47, 22, 34, 30, 7, 6, 11, 5, 4, 2, 21, 42, 35, 10, 39, 25, 3, 43, 16, 38, 37, 14, 13, 24, 15, 28, 19, 20, 44 }

    100

    {0, 1, 2, 4, 10, 13, 14, 18, 19, 23, 28, 29, 33, 35, 38, 41, 45, 48 }

    15

    Returns: 9.0

  60. {0, 3, 5, 2, 4, 8, 7, 1, 9, 6 }

    10

    {1, 3, 5, 7 }

    4

    Returns: 2.2

  61. {7, 3, 1, 9, 5, 2, 6, 0, 8, 4 }

    97

    {7, 5, 2, 6, 4 }

    6

    Returns: 3.515463917525773

  62. {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }

    100

    {9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }

    8

    Returns: 8.0

  63. {0, 2, 4, 3, 1 }

    100

    {0, 2, 3 }

    3

    Returns: 2.34

  64. {3, 4, 7, 2, 8, 5, 6, 1, 0, 9 }

    47

    {6, 3, 5, 2, 8, 7, 4 }

    8

    Returns: 6.297872340425532

  65. {31, 47, 27, 8, 2, 35, 41, 16, 10, 7, 33, 43, 45, 19, 1, 49, 24, 13, 3, 37, 48, 18, 20, 0, 40, 11, 32, 36, 26, 14, 5, 28, 22, 9, 21, 6, 34, 42, 39, 17, 46, 25, 30, 12, 38, 4, 44, 23, 29, 15 }

    100

    {47, 31, 27, 8, 2, 35, 41, 16, 10, 7, 33, 43, 45, 19, 1, 49, 24, 13, 3, 37, 48, 18, 20, 0, 40, 11, 32, 36, 26, 14, 5, 28, 22, 9, 21, 6, 34, 42, 39, 17, 46, 25, 30, 12, 38, 4, 44, 23, 29, 15 }

    50

    Returns: 50.0

  66. {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 0, 1 }

    100

    {3, 7, 8, 0, 1, 4, 6 }

    30

    Returns: 4.6


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: