As the output will contain 150 digits and even long int can’t store these many digits. So how can I solve this problem?
link to questions please.
Usually this problem gets resolved by printing the answer in modulo X. Meaning, usually, you don’t need to store 150 digits.
But if you really had to print 150 digits, then it depends on the language you use. Java has BigInteger for that. The closest I found for c++ were the external GNU Multiple Precision Arithmetic Library and the InfInt Library.
Here is the link to the actual question.
this problem is definitely harder than the suggested rating (648). Probably because it has a nice tutorial that makes the problem easy again: Tutorial for Small Factories
printf("\n"); } return 0;