← All problemsSign in

Occurence of number

Your job is to write a program which determines the maximum number of 2, 3 and 5 which should be multiplied to calculate the factorial of particular number. For example: 6!=6*5*4*3*2*1=(3*2)*(5)*(2*2)*(3)*(2)*(1), So the number of 2s which are multiplied here are 4, number of 3s=2 and number of 5s=1 Input First line of input consists number of test cases T (not more than 10). First line of each

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start