-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathATM.java
More file actions
31 lines (26 loc) · 738 Bytes
/
ATM.java
File metadata and controls
31 lines (26 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package problems.codechef;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Created by hardCode on 1/26/2016.
*/
public class ATM {
public static void main(String[] args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
float y;
int x;
String s[];
s=br.readLine().split("\\s");
x=Integer.parseInt(s[0]);
y=Float.parseFloat(s[1]);
if (x%5==0){
float amt=x+0.5F;
if (amt<y){
System.out.printf("%.2f",(y-amt));
}
else System.out.printf("%.2f", y);
}
else System.out.printf("%.2f",y);
}
}