this code is not submitted on the hackerblocks but successfully submitted on the spoj check this asap so that I can work on my apprach
Code not submitted on the hackerblocks
The answer is larger than 7 * 10^18. So for cases much larger than 64 30 the result will be much larger than this which will not fit in the normal range of long long int. That’s why you’re suggested to use BigInteger and i also mentioned that C++ student will face difficulty in handling this long cases because there is nothing like BigInteger in C++, you have to do this using normal arrays. Just read the constraints limit on spoj and hackerblocks as well and just try to calculate for some testcase that how big result You are getting and if it will fit in the long long int range.
Hope it helps.
let me know if you get any further issue with this approach.
Hey @jaiskid
If the doubt is resolved please mark it as resolved and give rating too if you wish too.