Hello
I saw lots of java problem and I'm a beginner , must of the problem required a test cases so the user can input how many test case he wants to test and then he will input how many line to the first test case , and so on
here is one of the problem I saw
Input
The first line contains the number of test cases T. T test cases follow:
The first line of each test case contains a number N. The next line
contains N integers, denoting the predicted price of WOT shares for the next N days.
Output
Output T lines, containing the maximum profit which can be obtained for the corresponding test case.
Constraints
1 <= T <= 10
1 <= N <= 50000
All share prices are between 1 and 100000
Sample Input
3
3
5 3 2
3
1 2 100
4
1 3 1 2
Sample Output
0
197
3
but the problem I work on ask me to
first ask the user to enter the minimum size of picture
then he enter how many pic he has, the number of picture will be the number of lines , each line had hight and width.
if the H and W is greater than the minimum size he would print crop it and it it's smaller he would print another and if it's just equal to the minimum size he would print accepted,,, so for each line there would be an output , I just receive one out put for the last input I wrote
sample input would be :
180
3
640 640
120 300
180 180
sample output :
CROPIT
ANOTHER
ACCEPTED
Thank you
What I have tried:
import java.util.*;
public class photo {
public static void main(String[] args){
Scanner input = new Scanner (System.in);
int M = input.nextInt();
int K = input.nextInt();
int y=0;
int x=0 ;
for (int i = 0; i <K; i++) {
x=Integer.parseInt(input.next());
y=Integer.parseInt(input.next());
}
if (x>M & y>M)
System.out.println("CROPIT");
else
if(x<M & y<M)
System.out.println("ANOTHER");
else
System.out.println("ACCEPTED");
}
}