Bỏ qua đến nội dung

C. Student

Mã bài: icpchusc2025p3 Nhóm: Uncategorized Dạng bài: Undefined

Giới hạn thời gian
1,0 s
Giới hạn bộ nhớ
256 MB
Điểm
1một phần
Tỉ lệ AC
56,5%
Người giải
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

Bình luận