Can anyone provide some hints to this problem? Although N <= 10^18 but there is some pattern which I am not able to detect.
I got it cooler!
#include <iostream> using namespace std;
using namespace std;
Here's the c++11 solution for beginners like me
#include <iostream>#include <string>
How to check the solution whether it is correct or not? Any link to debugger
How did you solve this one @keshav ?