Skip to content

C. Student

Problem code: icpchusc2025p3 Group: Uncategorized Problem type: Undefined

Time limit
1.0 s
Memory limit
256 MB
Points
1partial
AC rate
56.5%
Solvers
168

In a classroom with n male students and m female students, the teacher is organizing a discussion activity where each pair consists of one male and one female student.

Determine the number of ways to select one male and one female student to form a pair.

Input

  • The input starts with a positive integer t (1 \le t \le 10^4) — the number of test cases. Each test case is printed in a single line with two integers n and m (1 \le n,m \le 10^8).

Output

  • For each test case, print a single integer on a line — the number of ways to select one male and one female student to form a pair.

Example

Input
3
1 1
3 4
19 14
Output
1
12
266

Comments