Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <cmath>
  2.  
  3. class ASum
  4. {
  5.   public:
  6.   static long long findNb(long long m)
  7.   {
  8.     long long result = std::sqrt(std::sqrt(4.0 * m) - 1);
  9.    
  10.     return (4 * m == (std::pow(result, 2) * std::pow(result + 1, 2))) ? result : -1;
  11.   }
  12. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement