2337: Fake Problem

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:1 解决:1

题目描述

Filix is a acm lover. Also he is a acm master-hand, because he can figure out the time complexity’s recursion of every acm problem. The recursion is given as T(n)=a*T(n/b)+f(n).

In the recursion, n represents the scale of the acm problem, and the time complexity of f(n) is Θn^d.

Regretfully, Filix cannot figure out the final time complexity by the recursion. Can you help him?

Notice that Filix is not able to solve a Fake Problem. The acm problem is considered as a Fake Problem by Filix, only if the number a,b and d in the recursion satisfy the follow three requirements ,

1):The number a fulfill the essential condition that number c=(2^a)+1 is a prime number;

2):The result of b*(b+1)/2 is both even number and perfect number. When the sum of all the factors of a number equals to the value of double itself, the number is called as perfect number.

3):The number d satisfies that: d=(c^b)%b

输入

There are multiple input.

For each input, there will be a Integer n0<n<=10in the first linerepresenting the test case num of the input. And ,for each test case, there will be three integers a, b and d (0<a<63,0<b<=1000000,0<=d<b) in one line. 

输出

For each test case, just output only one line. If the acm problem to be solved is a Fake Problem, then just output ”So sorry!”, indicating that Filix cannot solve this problem. Otherwise ,output three non-negative integers:x,y and z, indicating that the final time complexity is

样例输入 复制

1
1 3 0
1
16 32769 57 

样例输出 复制

0 1 0
So sorry!

来源/分类