#CCBCHHAI0000020. Phiếu điểm hợp lệ (Average of the First Two Valid Scores)
Phiếu điểm hợp lệ (Average of the First Two Valid Scores)
Average of the First Two Valid Scores
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Read real-valued scores in order. Accept only scores in the inclusive interval and ignore all others. Take the first two accepted scores, compute their arithmetic mean, and print exactly two digits after the decimal point. The sequence ends at the second accepted score.
Input
Whitespace-separated real-valued scores with exactly two values in , the last being the second valid score. Each number has at most two fractional digits.
Output
Print the arithmetic mean with two fractional digits, rounding a half-cent upward.
Subtasks
- Subtask 1 (20%): At most 5 scores, each of absolute value at most 10; exactly two accepted scores.
- Subtask 2 (30%): At most 100 scores, each of absolute value at most 1000; exactly two accepted scores.
- Subtask 3 (50%): At most 100001 scores, each of absolute value at most 1000000; exactly two accepted scores.
Examples
Example 1
Input
11.00 -1.50 7.00 9.00
Output
8.00
Explanation
11.00 and -1.50 are rejected. The first two accepted scores are 7 and 9; their mean is 8.00.
Example 2
Input
0 10
Output
5.00
Explanation
Both endpoints 0 and 10 are accepted. Their mean is 5.00.