백준18665 IQ Test by 나정휘 about 백준
- ll > p ; int cnt = 0 ; set < p > st ; void dfs ( ll n ){ ll x = sqrt ( n ); if ( n != x * x ) x ++ ; ll y = x * x - n ; if ( x > 2 ) dfs ( x ); if ( y > 2 ) dfs ( y ); if (
- y })){ cnt ++ ; cout << x << " " << y << "
- y }); } } int main (){ ll n ; cin >> n ; dfs ( n ); assert ( cnt <= 43 ); }