Help me in solving MUFFINS3 problem

My issue

My code

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
	public static void main (String[] args) throws java.lang.Exception
	    Scanner sc=new Scanner(;
	    int T=sc.nextInt();
	    int N=sc.nextInt();

Problem Link: MUFFINS3 Problem - CodeChef

the answer would be n/2 +1 u get the maximum remainder .