<PREV Problem:
NEXT>
Solved by 4 users: UdH-WiNGeR, defrager, TonyZH, Dest.
UserDateAttemptTimeCMSC
TonyZH18 jun 2010C++6100.491243 
defrager03 apr 2009C++2203.062131 
UdH-WiNGeR09 mar 2009Java10006.272264 
Dest06 oct 2010C++2200.222296 
Languages
C++
3
Java
1
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Resistance PS-scheme, II

Time limit = 7 second(s)

Your have access to big box of resisters with R = 1.

You program should calculate PS-scheme with resistance R = M / N (see 094).

Input. One line with integers M and N. 1 ≤ M < 2000000, 0 < N < 2000000.

Output. PS-scheme descritpion. Use the minimal number of resisters.

Input#1
3 4
Output#1
[1 (1 1 1)]

Input#2
15 2
Output#2
(1 1 1 1 1 1 1 [1 1])

Input#3
1 3
Output#3
[1 1 1]

Input#4
6 5
Output#4
[(1 1) (1 1 1)]

Input#5
15 7
Output#5
(1 [(1 1) (1 1 [(1 1) 1])])

Author:
Artem Voroztsov
10 May 2006

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 210ms

SW soft NIX
ID = 34.204.176.125