#CCBCHHAI0000022. Hai điểm hợp lệ liên tiếp (First Two Valid Scores)

Hai điểm hợp lệ liên tiếp (First Two Valid Scores)

First Two Valid Scores

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

A device sends integer scores in order. A score is valid if it belongs to the closed interval [0,10][0,10]; every other value is ignored. Take the first two valid scores (they need not be adjacent in the input), compute their arithmetic mean, and stop immediately after the second valid score. For instance, in 7,−1,12,97,-1,12,9, choose 77 and 99.

Input

A whitespace-separated sequence of integers containing at least two valid scores. The last integer is exactly the second valid score; no further input follows.

Output

Print the arithmetic mean of the first two valid scores using exactly two digits after the decimal point.

Subtasks

  • Subtask 1 (20%): At most 55 values, each in [−20,20][-20,20].
  • Subtask 2 (30%): At most 100100 values, each in [−100,100][-100,100].
  • Subtask 3 (50%): At most 100000100000 values, each in [−1000,1000][-1000,1000].

Examples

Example 1

Input

7 -1 12 9

Output

8.00

Explanation

7 is accepted; -1 and 12 are rejected. 9 is the second accepted score. The mean is (7+9)/2 = 8.00.

Example 2

Input

0 10

Output

5.00

Explanation

Both endpoints 0 and 10 are accepted; the arithmetic mean is 5.00.