QOJ.ac

QOJ

时间限制: 1 s 内存限制: 512 MB 总分: 100

#5193. Challenging the Turing Award

统计

Background

The graph coloring problem is defined as follows: given a graph with $n$ vertices and $m$ edges, assign a color to each vertex such that no two adjacent vertices share the same color. The goal is to find the minimum number of colors required. As is well known, graph coloring is an $\mathsf{NPC}$ problem. If someone could solve the graph coloring problem in polynomial time, it would be equivalent to proving $\mathsf{P}=\mathsf{NP}$. Congratulations, you would be the next Turing Award winner!

Description

Today, your good friend Minke approached you, claiming that he has solved half of the graph coloring problem. He wants you to check if his approach is correct, and if you can help him verify it, he will consider sharing the Turing Award prize money with you. Minke claims to have solved the following problem: for an undirected graph with $n$ vertices labeled $1, 2, \dots, n$, an edge exists between two vertices if and only if their labels differ by at most $k$ modulo $n$. That is, an undirected edge exists between $(x, y)$ if and only if $x \neq y$ and there exists an $i$ such that $1 \le i \le k$ and $(x+i) \equiv y \pmod n$ or $(y+i) \equiv x \pmod n$. He claims he can quickly calculate the chromatic number of this graph. As a judge, you only need to solve a decision problem: for each test case, Minke provides three positive integers $n$, $k$, and $x$, representing his claim that the chromatic number of the graph (with $n$ and $k$ as defined above) is $x$. You need to determine if his answer is correct.

If you believe his answer is correct, output the line: Correct, but it doesn't necessarily mean that you can win the Turing Award. If you believe his answer is incorrect, output the line: Wrong, don't cheat me, you are too far away from the Turing Award. To make your answer more convincing, you must also output a character 0 or 1 on the second line: 0 indicates that you believe Minke's answer is less than the actual chromatic number of the graph, and 1 indicates that you believe his answer is greater than the actual chromatic number. If you believe this problem cannot be accurately determined with current computing power, output the line: The problem is unsolvable, please stop cheating me, Mr.Minke.

Input

The input consists of a single line containing three positive integers $n$, $k$, and $x$, as described in the problem statement.

Here, $1 \le x, n \le 10^{1,000,000}$ and $1 \le k \le 100$. All inputs are positive integers, and for all test cases, $n$ will only satisfy $n \le 10^5$ or $n \ge 10^{100}$.

Output

Output 1 or 2 lines. The first line represents your judgment result, formatted as described in the problem statement.

If you successfully complete the judgment and believe Minke's answer is incorrect, you must output a character 0 or 1 on the second line, where 0 means Minke's answer is too small, and 1 means Minke's answer is too large.

Examples

Input 1

6 2 4

Output 1

Wrong, don't cheat me, you are too far away from the Turing Award.
1

Note 1

It is obvious that coloring vertices $1-6$ with $1, 2, 3, 1, 2, 3$ is feasible, so the chromatic number for $n=6$ and $k=2$ is $3$.

Note

  1. If you have no ideas, please re-read the data ranges provided in the problem statement; it might be helpful for solving the problem.
  2. Hint 1 might not be useful.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.