Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main(){
- long long n; cin>>n;
- for(long long x=0; x<=1000000000; x++){
- for(long long y=1; y<=1000000000; y++){
- if((x*x+y*y)%n==0){
- cout<<x<<" "<<y;
- return 0;
- }
- }
- }
- cout<<"No solutions";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment