Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a,b,k,n;
  8. cin >> a >> b;
  9. k=1;
  10. do {k+=1;} while ((a*b*k+1)!=(round(sqrt(a*b*k+1)))*(round(sqrt(a*b*k+1))));
  11. n=sqrt(a*b*k+1);
  12. cout << n;
  13. return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement