# include <bits/stdc++.h>
# define int long long
using namespace std;
const int N= 1e5 + 5 ;
signed main ( )
{
ios_base:: sync_with_stdio ( 0 ) ;
int T;
cin>> T;
while ( T-- )
{
int x, y;
cin>> x>> y;
int d= x+ y;
if ( d& 1 ) { cout<< "-1 -1\n" ; continue ; }
d/= 2 ;
if ( x== y)
{
cout<< x<< " 0\n" ;
}
if ( x> y)
{
cout<< d- y<< ' ' << y<< "\n" ;
}
if ( x< y) cout<< x<< ' ' << d- x<< "\n" ;
}
}
# include <bits/stdc++.h>
# define int long long
using namespace std;
const int N= 1e5 + 5 ;
int ans[ N] , vis[ N] ;
signed main ( )
{
ios_base:: sync_with_stdio ( 0 ) ;
int T;
cin>> T;
while ( T-- )
{
int n, a, b;
cin>> n>> a>> b;
for ( int i= 1 ; i<= n; i++ ) ans[ i] = vis[ i] = 0 ;
vis[ a] = vis[ b] = 1 ;
int t= n/ 2 - 1 , tot= 0 , fg= 1 ;
for ( int i= n; i> a && t; i-- )
{
if ( ! vis[ i] )
{
ans[ ++ tot] = i;
vis[ i] = 1 ;
t-- ;
}
}
if ( t) fg= 0 ;
for ( int i= 1 ; i<= n; i++ )
{
if ( ! vis[ i] && i> b) fg= 0 ;
}
if ( fg== 0 ) cout<< "-1\n" ;
else
{
cout<< a<< ' ' ;
for ( int i= 1 ; i<= tot; i++ ) cout<< ans[ i] << ' ' ;
cout<< b<< ' ' ;
for ( int i= 1 ; i<= n; i++ )
{
if ( ! vis[ i] ) cout<< i<< ' ' ;
} cout<< endl;
}
}
}
# include <bits/stdc++.h>
# define int long long
using namespace std;
const int N= 1e5 + 5 ;
int ans[ N] , vis[ N] ;
int solve ( int x)
{
int l= 1 , r= 1e9 , ans;
while ( l<= r)
{
int mid= l+ r>> 1 ;
int t= ( 1 + mid) * mid/ 2 ;
if ( t== x) { ans= mid; break ; }
if ( t> x) r= mid- 1 ;
else l= mid+ 1 , ans= mid+ 1 ;
}
return ans;
}
int solve2 ( int x)
{
int l= 1 , r= 1e9 , ans;
while ( l<= r)
{
int mid= l+ r>> 1 ;
int t= ( 1 + mid) * mid/ 2 ;
if ( t== x) { ans= mid; break ; }
if ( t> x) r= mid- 1 ;
else l= mid+ 1 , ans= mid;
}
return ans;
}
signed main ( )
{
ios_base:: sync_with_stdio ( 0 ) ;
int T;
cin>> T;
while ( T-- )
{
int k, x;
cin>> k>> x;
int md= ( 1 + k) * k/ 2 , ans= 0 ;
if ( x> md+ md- k- 1 ) { cout<< 2 * k- 1 << "\n" ; continue ; }
if ( x<= md)
{
ans= solve ( x) ;
}
else
{
ans= 2 * k- 1 ;
x= md+ md- k- x;
ans-= solve2 ( x) ;
}
cout<< ans<< endl;
}
}
# include <bits/stdc++.h>
# define int long long
using namespace std;
const int N= 1e5 + 5 ;
int gcd ( int a, int b, int x)
{
if ( b> a) swap ( a, b) ;
if ( a< x && b< x) return 0 ;
if ( b== 0 )
{
if ( a== x) return 1 ;
else return 0 ;
}
if ( a% b== x% b || b== x) return 1 ;
else return gcd ( b, a% b, x) ;
}
signed main ( )
{
ios_base:: sync_with_stdio ( 0 ) ;
int T;
cin>> T;
while ( T-- )
{
int a, b, x;
cin>> a>> b>> x;
if ( gcd ( a, b, x) )
{
cout<< "YES" << endl;
}
else cout<< "NO" << endl;
}
}