Video Solution for Codeforces Round 893 DIV 2 - Problem A in #JAVA
connect with me @ https://amanraj-website.netlify.app
Hello fellow programmers,
For those of you who participated in Codeforces Round 893 DIV 2 and were working on Problem A, here is the solution in JAVA
Video Solution Link: CODEFORCES ROUND 893 DIV2 PROBLEM A: Buttons - YouTube
Problem statement link: https://codeforces.com/contest/1858/problem/A
Solution in JAVA
import java.util.*;
public class test {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt(); //for total number of test cases
for (int i = 0; i < t; i++) {
int a, b, c;
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();
int qwerty = c/2;
a = a + c - qwerty;
b = b + qwerty;
if(a>b)
{
System.out.println("First"); //Anna will win
}
else
{
System.out.println("Second"); //else Katie
}
}
sc.close();
}
}
No comments:
Post a Comment