Https://hack.codingblocks.com/contests/c/452/815

https://hack.codingblocks.com/contests/c/452/815
my code -https://ide.codingblocks.com/#/s/23668
please tell ki modulo kaise use karna does it require usage of modulo inverse calculation through totient

No , its just require simple method of finding prime factors of number.
Store the frequencies of each prime facors of ai. And then it will be of the form p1^(b1)p2^(b2)
Now , you can easily calculate its total number of factors
Take a look on this code
https://ide.codingblocks.com/#/s/24040