<PREV Problem:
NEXT>
Solved by 277 users: ...
UserDateAttemptTimeCMSC
asp01 dec 2009Ruby1800.0651 
stasg701 dec 2009Ruby3600.11108 
AsukaNoKaze16 may 2006C++100.02109 
JohnJones_00115 may 2006C++100.03109 
g20151317 may 2006C++100.03110 
lcosvse16 may 2006C++200.03119 
Huang_SR04 jul 2006C++100.03125 
cyberian24 feb 2007C++800.02126 
vviswa14 may 2007C++900.06127 
fetetriste01 may 2007C++800.06128 
Languages
C++
162
FPC
41
C
25
Kylix
21
Java
20
Ruby
5
Python
4
Haskell
1
Scheme
1
Perl
1
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Resistance PS-scheme

Time limit = 2 second(s)

PS-scheme is paralleled PS-schemes (denoted by "[s1 s2 ... sk]" . Scheme resistance is R: 1/R = 1/R1 + 1/R2 + .. + 1/Rk ),
OR
sequence of PS-schemes (denoted by "(s1 s2 ... sm)" ) . Scheme resistance is R: R = R1 + R2+ .. + Rm,
OR
single resister with resistence R (denoted by "R").

For example:

Resistance scheme sample

Input. One line with resistance PS-scheme description. Resistance values are real numbers from segment [0, 100000]. Input length less than 200000 bytes.

Output. Resistance of the scheme.

Input#1
[2 2 2]
Output#1
.6666667

Input#2
([1 1] 0.5 [3.2 (1 1)])
Output#2
2.230769

Input#3
(3 0 1)
Output#3
4

Author:
Voroztsov Artem
9 May 2006

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


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

SW soft NIX
ID = 18.232.55.175