Professional Documents
Culture Documents
91@gmail.c: Monika4
91@gmail.c: Monika4
monika4
Alice and Bob
aniy
mpnikach
Findthe probability of Bob winning the qame, for given A and
integerpart of the probability after multiplying it by 10.
monikachirat
B. Let S denote the
31-JUL
Yourtask is to find S.
@gmail.com
91@gme
a091@gmg
Input Format
The first line contains a long, A, denoting the first given number.
22
menikachir
UL
2022
monikad
Constraints
1= A = 10 12
1c B 10 12
Code is
monikachiraniya091@
1
31-JUL-202
Sample Input SampleOutput
1000000
Explanation a
1 Thus, output
monikachiraniya091
2
2
500000
1 1000000=1000000
monikachiraniy
31
09 from
[1,2,3.4,5,6,7,8,9,10], 2
hence his probability of
winning is 0.4(will win for
2,4,6,8). Thus, output
mo
0.4 1000000-400000
import java.io.";
2 import java.util.a
3 import java,lang.Math;
5
6 class Solution
7 publicstatic int BobProbab(long A,long B)
I Write your code here
9
10
11
12 public static void main(Stringl args)
13 Scanner scan= new Scanner(System.in)
14
15 long A Long.parsel.ong(scan.nextLine0.trim0)
=
16
17 long B Long-parsel.ong(scan.nextLine0.trim)
18
19 int result= BobProbab(A, B);
20
21 System.out.printin(result);
22
23
1import sys
I
4 def BobProbab(A, B):
5 # Write your code here
1
8
9 def main0:
10 A= sys.stdin.readline0.strip0
11
12 B sys.stdin.readline0.strip0
13
14 result BobProbab(A, B)
15
16 print(result)
17
18
1 9 if n a m e
="main_"
20 main0