PUCMM009 - David and his Obsession
You are walking by an empty corridor at PUCMM. All around you are arithmetic expressions written on the walls and on the floor. You find it odd and quickly realize all these expressions seem to be failed attempts to solve a problem. As you read by, you hear a voice coming from one of the classrooms that is whispering “I do not see it! I do not see it!” You walk to the classroom and find David rolling on the floor in frustration.
“What’s going on, David? you ask.
“The answer.. I do not see! Do you see?” replies David.
“What answer?” you ask him.
“Professor Olson gave me this problem and … I do not see.”
“Ok. What about you stand up and describe the problem to me?” you ask again.
“Well, OK. You are pretty smart yourself. Imagine ten slips of paper bearing the numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 are put into a hat. 5 slips are drawn at random and laid out in a row in the order in which they were drawn.” He sighs deeply. “What is the probability that the 5-digit number so formed is divisible by 495?”
On your backpack there is a laptop. Help him. Write an algorithm that solves the problem.
Input
There is no input for this problem.
Output
Print in a single line the answer as a fraction expressed in its lowest terms.
Sample cases
There are no sample cases for this problem.
Notes
In case you need this, the greatest common divisor of (a, b) is defined recursively as follows:
gcd(a, b) = b if a == 0, otherwise gcd = gcd(b mod a, a).
hide comments
David:
2020-04-03 18:49:56
Like the problem name. 250th solved problem. Last edit: 2020-04-03 18:50:22 |
|
riyansh16_:
2019-01-09 20:03:01
they are also considering 01234 type of no as 5 digit no . So take care as digit at ten thousand place can be 0 |
|
karthik1997:
2018-01-06 19:31:23
Fraction Printing is a/b (a is numerator and b is denominator ) . Rest is history :) |
|
mcjoshi:
2016-02-28 08:32:55
Its a easy mathematical problems(P&C + probability) !
|
|
:.Mohib.::
2015-07-21 19:53:20
Can be solved using brainf**k ;) |
|
Dushyant Singh:
2015-07-06 21:14:38
We have to consider 4 digit numbers also. My shortest code ever written on spoj! :-) And my first python submission. :-P |
|
DHEERAJ KUMAR:
2015-06-16 23:58:52
My 100th problem on spoj :)
|
|
Kid Algorist:
2014-10-24 01:32:34
5 digits include cases with 0 at beginning.
|
Added by: | kojak_ |
Date: | 2013-06-15 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Yaglom Challenging Mathematical Problems With Elementary Solutions |