#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(a) (a).begin(), (a).end()
#define fillchar(a, x) memset(a, x, sizeof(a))
#define huan printf("\n")
#define debug(a,b) cout<<a<<" "<<b<<" "<<endl
#define ffread(a) fastIO::read(a)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int maxn=1e6+,inf=0x3f3f3f3f;
int main()
{
int T;
scanf("%d", &T);
while (T--)
{
ll n, a, b, c;
scanf("%lld%lld", &n, &a);
if (n == )
{
printf("%lld %lld\n", , +a);
}
else if (n == )
{
if (a % == )
{
ll tmp = (a-)/;
b = *tmp*tmp+*tmp;
c = b+;
printf("%lld %lld\n", b, c);
}
else
{
ll tmp = a/ - ;
b = tmp*tmp + *tmp;
c = b + ;
printf("%lld %lld\n", b, c);
}
}
else
printf("-1 -1 \n");
}
return ;
}
勾股数https://wenku.baidu.com/view/8282f1b669eae009591bec85.html