Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- class ASum
- {
- public:
- static long long findNb(long long m)
- {
- long long result = std::sqrt(std::sqrt(4.0 * m) - 1);
- return (4 * m == (std::pow(result, 2) * std::pow(result + 1, 2))) ? result : -1;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement