ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1083. Factorials!!!

The problem description is not clear
Posted by Zhihua Lai 26 Jan 2007 20:43
It doesn't say should not multiply a number smaller than zero.
Re: The problem description is not clear
Posted by Entheogen 14 Nov 2007 07:09
I agree.  Also what about 4!!!! = 4 ?

I dont understand why that is.  Shouldn't it be 4(4-1*4) = 0

and the last number in sequence (n%k) is apperently not a multiplier?
Re: The problem description is not clear
Posted by Sandro (USU) 14 Nov 2007 11:25
We want to calculate 4!!!! n=4, k=4. Second case in definition: n!!…!=n(n-k)(n-2k)…k, if k divides n. So 4!!!! = 4.

For example, 6!=6*5*4*3*2*1, 6!!=6*4*2, 6!!!=6*3, 6!!!!=6*2, 6!!!!!=6*1, 6!!!!!!=6.