-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrading_Students.java
More file actions
41 lines (26 loc) · 907 Bytes
/
Grading_Students.java
File metadata and controls
41 lines (26 loc) · 907 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
32
33
34
35
36
37
38
39
40
41
// Challenge link : https://www.hackerrank.com/challenges/grading/problem?isFullScreen=true
// Git Hub REPO Link : https://github.com/piyushpatelcodes/100-Days-Java-Hackerrank
import java.util.*;
import java.math.*;
public class Grading_Students {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
for(int a0 = 0; a0 < n; a0++){
int grade = in.nextInt();
if(grade < 38){
System.out.println(grade);
}
else{
int q = grade/5;
int rem = grade%5;
if(rem >= 3){
System.out.println((q+1)*5);
}
else{
System.out.println(grade);
}
}
}
}
}