<PREV Problem:
NEXT>
Solved by 4 users: UdH-WiNGeR, defrager, TonyZH, Dest.
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 

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 180ms

SW soft NIX
ID = 54.80.60.91