CF1096A.Find Divisible

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given a range of positive integers from ll to rr.

Find such a pair of integers (x,y)(x, y) that l≤x,y≤rl \le x, y \le r, x≠yx \ne y and xx divides yy.

If there are multiple answers, print any of them.

You are also asked to answer TT independent queries.

给你一个从 ll 到 rr 的正整数区间。

请找出一对整数 (x,y)(x, y),满足 l≤x,y≤rl \le x, y \le r,x≠yx \ne y,且 xx 整除 yy。

若存在多组解,输出任意一组即可。

你还需要回答 TT 个相互独立的查询。

输入格式

The first line contains a single integer TT (1≤T≤10001 \le T \le 1000) — the number of queries.

Each of the next TT lines contains two integers ll and rr (1≤l≤r≤9982443531 \le l \le r \le 998244353) — inclusive borders of the range.

It is guaranteed that testset only includes queries, which have at least one suitable pair.

第一行包含一个整数 TT(1≤T≤10001 \le T \le 1000)—— 查询次数。

接下来的 TT 行,每行包含两个整数 ll 和 rr(1≤l≤r≤9982443531 \le l \le r \le 998244353)—— 区间的闭区间边界。

保证测试数据中所有查询均至少存在一对满足条件的数。

输出格式

Print TT lines, each line should contain the answer — two integers xx and yy such that l≤x,y≤rl \le x, y \le r, x≠yx \ne y and xx divides yy. The answer in the ii-th line should correspond to the ii-th query from the input.

If there are multiple answers, print any of them.

输出 TT 行,每行应包含答案——两个整数 xx 和 yy,满足 l≤x,y≤rl \le x, y \le r,x≠yx \ne y,且 xx 整除 yy。第 ii 行的答案应对应输入中的第 ii 个查询。

若存在多个答案,输出任意一个即可。

输入输出样例

  • 输入#1

    3
    1 10
    3 14
    1 10

    输出#1

    1 7
    3 9
    5 10

输入解题思路,AI测评打分。不知道怎么写?

首页