My issue
how to solve
My code
# cook your dish here
t=int(input())
for i in range(t):
n,m=list(map(int,input().split()))
z=n//m
print(min(z))
Problem Link: CS2023_GYM Problem - CodeChef
how to solve
# cook your dish here
t=int(input())
for i in range(t):
n,m=list(map(int,input().split()))
z=n//m
print(min(z))
Problem Link: CS2023_GYM Problem - CodeChef
Your answer is
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc = new Scanner(System.in);
int t = sc.nextInt(); //test case
while(t–>0){
int N = sc.nextInt();
int M = sc.nextInt();
int d = M/2; // majority votes means more than half of the total votes
System.out.println(d+1);
}
}
}