Jony lives in a “Bachelor’s house” with some of his friends. You may assume it as a hostel but it do…
Click here to read the complete problem statement.
If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.
import java.util.Scanner;
public class aa {
public static void main(String[] args) {
Scanner x=new Scanner(System.in);
int t=x.nextInt();
for(int i=1;i<=t;i++) {
int n1=x.nextInt();
int n2=x.nextInt();
int n3=x.nextInt();
int n4=x.nextInt();
int n5=x.nextInt();
int n6=x.nextInt();
int sum1=n1+n2+n3+n4+n5+n6;
int b=x.nextInt();
int m1=x.nextInt();
int m2=x.nextInt();
int m3=x.nextInt();
int m4=x.nextInt();
int m5=x.nextInt();
int m6=x.nextInt();
int sum2=m1+m2+m3+m4+m5+m6;
int ans=sum2-(b-sum1);
if(ans>=0) {