fork download
  1. //Bai 9
  2.  
  3. #include<bits/stdc++.h>
  4. using namespace std;
  5. #define el "\n"
  6. #define ll long long
  7. #define ull unsigned long long
  8. #define se second
  9. #define fi first
  10. #define be begin()
  11. #define en end()
  12. #define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
  13.  
  14. void Run(int n)
  15. {
  16. int ok = 0;
  17. for(int i = 1; i <= sqrt(n); i++)
  18. {
  19. if(i * (i + 5) == n)
  20. {
  21. cout << i;
  22. ok = 1;
  23. break;
  24. }
  25. }
  26. if(ok == 0) cout << "NO";
  27. }
  28. int main()
  29. {
  30. Faster;
  31. int n; cin >> n;
  32. Run(n);
  33. return 0;
  34. }
  35.  
  36.  
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
NO