题库练习 Divisors and Table
← 上一题 下一题 →

A15697 | Divisors and Table

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

You are given an $n \times n$ multiplication table and a positive integer $m = m_1 \cdot m_2$ . A $n \times n$ multiplication table is a table with $n$ rows and $n$ columns numbered from $1$ to $n$ , where $a_{i, j} = i \cdot j$ .

For each divisor $d$ of $m$ , check: does $d$ occur in the table at least once, and if it does, what is the minimum row that contains $d$ .

输入格式

The first line contains a single integer $t$ ( $1 \le t \le 10$ ) — the number of test cases.

The first and only line of each test case contains three integers $n$ , $m_1$ and $m_2$ ( $1 \le n \le 10^9$ ; $1 \le m_1, m_2 \le 10^9$ ) — the size of the multiplication table and the integer $m$ represented as $m_1 \cdot m_2$ .

输出格式

For each test case, let $d_1, d_2, \dots, d_k$ be all divisors of $m$ sorted in the increasing order. And let $a_1, a_2, \dots, a_k$ be an array of answers, where $a_i$ is equal to the minimum row index where divisor $d_i$ occurs, or $0$ , if there is no such row.

Since array $a$ may be large, first, print an integer $s$ — the number of divisors of $m$ that are present in the $n \times n$ table. Next, print a single value $X = a_1 \oplus a_2 \oplus \dots \oplus a_k$ , where $\oplus$ denotes the [bitwise XOR operation](https://en.wikipedia.org/wiki/Bitwise_operation#XOR).

输入输出样例

输入 #1
3
3 72 1
10 10 15
6 1 210
输出 #1
6 2
10 0
8 5
C++ 编辑器
输入
输出