A. Find Divisible Educational Codeforces Round 57 (Rated for Div. 2)

A - Find Divisible

题意:英语翻译题,给你一个l,r区间,要求输出x,y,[x,y]在区间[l,r]中,y是x的倍数,原文中是这样写的

x divides y  x被y整除

妈蛋,不用担心,x*2超出r边界,因为题上也说了,一定存在解,原文是这样的

妈蛋

题解:左边界l,右边界l*2,妈蛋。

代码:

#include <iostream>
using namespace std;
#define int long long
signed main(){
    //cout << "Hello world!" << endl;
    int t;
    cin>>t;
    while(t--){
        int l,r;
        cin>>l>>r;
        cout<<l<<" "<<l*2<<endl;
    }
    return 0;
}

output

standard output

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≤x,y≤r, x≠yx≠y and xx divides yy.

If there are multiple answers, print any of them.

You are also asked to answer TT independent queries.

Input

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

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

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

Output

Print TT lines, each line should contain the answer — two integers xx and yy such that l≤x,y≤rl≤x,y≤r, x≠yx≠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.

Example

input

Copy

3
1 10
3 14
1 10

output

Copy

1 7
3 9
5 10
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值