Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.lang.*;
- import java.io.*;
- /* Name of the class has to be "Main" only if the class is public. */
- class Codechef
- {
- public static void main (String[] args)
- {
- Scanner input=new Scanner(System.in);
- int t=input.nextInt();
- while(t>0) {
- int box1 = input.nextInt();
- int box2 = input.nextInt();
- int box3 = input.nextInt();
- int total_size = input.nextInt();
- BoxSize(box1, box2, box3, total_size);
- t--;
- }
- }
- public static void BoxSize(int box1, int box2, int box3, int total_size){
- int sum=box1+ box2+box3;
- if (sum==total_size){
- System.out.println(1);
- }
- else if (sum>=box3+box2||sum>=box2+box1){
- System.out.println(2);
- }
- else{
- System.out.println(3);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement