Created
September 8, 2015 13:29
-
-
Save markroxor/5fb5e9f412d0e31a929f to your computer and use it in GitHub Desktop.
Incorrect- BANROB (LONG SEPT CF)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mon = 1000000000 | |
t = raw_input() | |
t = int(t) | |
for _ in xrange(t): | |
m,p = raw_input().split(); | |
m = int(m) | |
p = float(p) | |
if not p: | |
if(m&1): | |
print "1000000000.0 0.0" | |
else: | |
print "0.0 1000000000.0" | |
continue | |
if m%2: | |
fir=mon*(1+p**m) | |
else: | |
fir=mon*(p+p**m) | |
fir/=(1+p) | |
print fir, mon-fir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment