import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main
{
void help(int n){
int[] ar = {0,0,0,0};
//int n = 3;
int m = 0;//,k=1;
for(int i=1;i<=n;i++){
ar[m] += i;
if((m+1)<=3) m+=1;
else m=0;
}
System.out.println((ar[0] - ar[2]) + " " + (ar[1] - ar[3]));
}
void get() throws java.io.IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
int[] val = new int[t];
for(int i =0;i<t;i++) val[i] = Integer.parseInt(br.readLine());
for(int l =0;l<val.length;l++) help(val[l]);
}
public static void main(String args[]) throws java.io.IOException{
Main hs = new Main();
hs.get();
}
}
Guys this is my solution. How do I optimize this problem?