7592: Product

内存限制:524 MB 时间限制:5 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:0 通过:0

题目描述

You are given a prime p . For a number a , you need to find positive integers x1,x2,,xk such that xia(modp) , and xi2500 . Output any valid solution.

输入格式

The first line contains a prime p(1p1018) , p is chosen uniformly and randomly from [0.9×1018,1018] .

The second line contains a integer q(1q100) . Each line of the following q lines contains an integer a(1ap1) , a is chosen from [1,p1] uniformly and randomly.

输出格式

Output q lines for each number. In each line, prine k first, then x1,x2,,xk .

输入样例 复制

178187
3
6
100
109065

输出样例 复制

2 2 3
1 100
2 1000 1000