/* package codechef; // don’t place package name! */
import java.util.;
import java.lang.;
import java.io.*;
/* 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
{
// your code goes here
try{
Scanner sc =new Scanner(System.in);
int T = sc.nextInt();
while(T!=0){
int N = sc.nextInt();
int K = sc.nextInt();
int max;
int pair;
// if(N/2 > K){
// max = (N/K) + 1;
// pair = N/max - 1;
// System.out.println(max + " " + pair);
// }
// if(N/2 < K){
// int M = K - 1;
// max = N/M;
// pair = N/max - 1;
// System.out.println(max + " " + pair);
// }
if(N%K != 0){
max = N/K + 1;
pair = N - K*(N/K);
System.out.println(max + " " + pair );
}
if(N/2 == K){
max = N/K;
pair = K;
System.out.println(max + " " + pair);
}
T--;
}
}
catch(Exception e){
return ;
}
}
}
why getting TLE if my code just ran in “0.14” seconds and time limit was “0.5” seconds ??