4700: P8762 [蓝桥杯 2021 国 ABC] 123

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Input

Output

Sample Input Copy

3
1 1
1 3
5 8

Sample Output Copy

1
4
8

HINT