#C3963. Highest Dart Score
Highest Dart Score
Highest Dart Score
You are given an integer N representing the number of darts and a list of integers representing the possible scores for hitting each target on a dartboard. Your task is to calculate the highest total score a player can achieve by throwing all N darts.
The optimal strategy is to always aim for the target with the maximum score. Hence, the answer can be computed using the formula:
For example, if N = 3 and scores are [10, 20, 30, 40], the highest total score is 3 \times 40 = 120.
inputFormat
The input is read from stdin and consists of two lines.
- The first line contains an integer N, denoting the number of darts.
- The second line contains a space-separated list of integers, representing the scores for hitting each target on the dartboard.
outputFormat
Output the highest possible total score to stdout. The score is an integer computed as:
$$ Score = N \times \max(\text{scores}) $$## sample3
10 20 30 40
120
$$