lina_os

Untitled

Nov 4th, 2024
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7.  
  8. long long n; cin>>n;
  9. for(long long x=0; x<=1000000000; x++){
  10. for(long long y=1; y<=1000000000; y++){
  11. if((x*x+y*y)%n==0){
  12. cout<<x<<" "<<y;
  13. return 0;
  14. }
  15. }
  16. }
  17. cout<<"No solutions";
  18.  
  19. return 0;
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment