Statistics

Problem Statement for "SimpleDarts"

Problem Statement

You are playing a game of darts. The target in this particular game looks as follows:

  • There are F regular sectors. These are worth 1, 2, ..., F points.
  • There are F "double points" sectors. These are worth 2, 4, ..., 2*F points.
  • There are F "triple points" sectors. These are worth 3, 6, ..., 3*F points.
  • There is the bullseye in the middle of the target. The bullseye consists of two sectors: the outer bullseye (worth 25 points) and the inner bullseye (worth 50 points).

You have three darts. What is the largest total number of points you can get if you hit three different sectors?

Definition

Class:
SimpleDarts
Method:
highestScore
Parameters:
int
Returns:
int
Method signature:
int highestScore(int F)
(be sure your method is public)

Constraints

  • F will be between 1 and 100, inclusive.

Examples

  1. 20

    Returns: 171

    A regular dartboard has numbers 1 through 20. If we want to produce the highest score we can by hitting three distinct sectors, we should hit the triple-20, triple-19, and triple-18 for a total of 3*20 + 3*19 + 3*18 = 171 points.

  2. 1

    Returns: 78

    This tiny target has only five sectors. These are worth 1, 2, 3, 25, and 50 points. Clearly the optimal solution is to score 3 + 25 + 50 = 78 points.

  3. 9

    Returns: 102

    Now the optimal play is to hit the inner bullseye (50), the outer bullseye (25), and the triple-9 (27 points).

  4. 2

    Returns: 81

  5. 3

    Returns: 84

  6. 4

    Returns: 87

  7. 10

    Returns: 107

  8. 11

    Returns: 113

  9. 12

    Returns: 119

  10. 13

    Returns: 125

  11. 14

    Returns: 131

  12. 15

    Returns: 137

  13. 16

    Returns: 143

  14. 17

    Returns: 149

  15. 18

    Returns: 155

  16. 19

    Returns: 162

  17. 47

    Returns: 414

  18. 74

    Returns: 657

  19. 97

    Returns: 864

  20. 100

    Returns: 891

  21. 8

    Returns: 99

  22. 98

    Returns: 873

  23. 24

    Returns: 207


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: