Skip to content

Commit d756d79

Browse files
authored
growling gears kattis
1 parent c86c477 commit d756d79

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Kattis/growlinggears/Main.java

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import java.util.Scanner;
2+
3+
/**
4+
* Created by AMK on 8/11/2019.
5+
* Life is nice :)
6+
* Enjoy coding :D
7+
*/
8+
public class Main {
9+
public static void main(String[] args) {
10+
Scanner scanner = new Scanner(System.in);
11+
int t = scanner.nextInt();
12+
for (int i = 0; i < t; i++) {
13+
int n = scanner.nextInt();
14+
int id = 0;
15+
int max = Integer.MIN_VALUE;
16+
for (int j = 0; j < n; j++) {
17+
int a = scanner.nextInt();
18+
int b = scanner.nextInt();
19+
int c = scanner.nextInt();
20+
int res = (b * b) /(4 * a) + c;
21+
if (res > max){
22+
max = res;
23+
id = j + 1;
24+
}
25+
}
26+
System.out.println(id);
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)