logo AlgoBeat OnlineJudge
登录 注册

#208808. [ICPC 2022 Xi'an R] Find Maximum

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

We define a function over all non-negative integer as follows:

Calculate .

You need to answer queries independently.

输入格式

The first line contains a single integer ().

Each of the next lines contains two integers and (), representing a query.

输出格式

Output lines. The -th line contains a single integer, representing the answer to the -th query.

样例

样例输入 1

10
1 2
1 3
1 4
1 5
2 3
2 4
2 5
3 4
3 5
4 5

样例输出 1

3
3
4
5
3
4
5
4
5
5

数据范围与提示

Source: The 2022 ICPC Asia Xi'an Regional Contest Problem E.

Author: MagicSpark.