-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvenPSum.java
More file actions
18 lines (17 loc) · 807 Bytes
/
EvenPSum.java
File metadata and controls
18 lines (17 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.io.*;
import java.util.*;
import java.lang.*;
class Main {
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int T = Integer.parseInt(st.nextToken());
for(int i = 0;i<T;i++) {
BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st1 = new StringTokenizer(br1.readLine());
long first = Integer.parseInt(st1.nextToken());
long second = Integer.parseInt(st1.nextToken());
System.out.println((first/2) * (second/2) + (first / 2 + ((first % 2 == 0) ? 0 : 1)) * (second / 2 + ((second % 2 == 0) ? 0 : 1)));
}
}
}