0
点赞
收藏
分享

微信扫一扫

Educational Codeforces Round 92 (Rated for Div. 2) A.LCM Problem

Aliven888 2022-09-26 阅读 118

地址:​​http://codeforces.com/contest/1389/problem/A​​

题意:

不说了,很清晰了。

解析:

我们选择的x,y越大,lcm(x,y)就会更大,越有可能越R这个右界限

所以L做为最小,如果2*L越界,是一定无解的。

#include<bits/stdc++.h>
#include<iostream>
#include<cstring>
#include<string.h>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
const int maxn=2e2+20;
int a[maxn][maxn];
int main()
{

int t;
scanf("%d",&t);
while(t--)
{
ll l,r;
cin>>l>>r;
if(2*l<=r)
cout<<l<<" "<<2*l<<endl;
else
cout<<"-1 -1"<<endl;
}
}

 



举报

相关推荐

0 条评论