#P1224. [NOI2013] 向量内积
[NOI2013] 向量内积
Description
{{The dot product of two -dimensional vectors and is the sum of the products of their corresponding coordinates, i.e.:
$$(A,B)=\sum_{i=1}^d a_ib_i=a_1b_1+a_2b_2+\ldots+a_db_d$$Given -dimensional vectors , Xiao Miaomiao (pinyin) wants to know whether there exist two vectors whose dot product is a multiple of . Please help her solve this problem.}}
Input Format
{{The first line contains positive integers , representing the number of vectors, the dimension, and the multiple to check, respectively.
The next lines each contain non-negative integers. In the -th line, the -th integer is the -th coordinate value of vector .}}
Output Format
{{Output two integers separated by a space.
If there exist two vectors whose dot product is an integer multiple of , output their indices and (require ). If there are multiple valid pairs, output any one of them.
If no such pair exists, output two .}}
3 5 2
1 0 1 0 1
1 1 0 1 0
0 1 0 1 1
2 3
Hint
{{### Constraints
| Test point ID | ||||
|---|---|---|---|---|
| ^ | ^ | |||
| ^ | ||||
| ^ | ^ | |||
| ^ | ||||
| ^ | ||||
| ^ | ||||
Translated by ChatGPT 5
京公网安备 11011102002149号