Help me in solving LBJ208A problem

My issue


My code

class Chef{
    public static void main(String args[]){
        Scanner i =new Scanner(;
        int T =i.nextInt();
        int N =i.nextInt();
        int M =i.nextInt();

Learning course: Beginner DSA in Java
Problem Link: CodeChef: Practical coding for everyone

Hi @dhanushgowda17
Scanner i = new Scanner(;
–>it’s used to read input from the standard input stream ( ).
int T = i.nextInt();
–>This part of the code reads an integer T from the user, which typically represents the number of test cases.
while (T > 0) {
–>Then, it enters a while loop that will execute as long as T is greater than zero.
int N = i.nextInt();
int M = i.nextInt();
–>Inside the while loop, it reads two integers N and M for each test case.
–>At the end of each iteration of the while loop, it decrements the value of T. This is a common pattern used to iterate through a specific number of test cases.

Here is the correct code for the mentioned problem.

import java.util.Scanner;
public class Main
public static void main(String args) {
Scanner s = new Scanner(;
int T = s.nextInt();
while (T > 0) {
int r = s.nextInt();
int l = s.nextInt();
else if(l/r==2){
If you want detailed explanation kindly reply to this msg.
Thank you :smiley: :smiley: