IQ Test
Time limit1sMemory limit512 MB
Given n up to 10^18, output at most 43 operations x^2 - y on a set starting with 0, 1, 2 so that n ends up in the set.
- Level
Medium7 of 10
- Topics
- Math, Bit manipulation, Implementation
- Solved
- No attempts yet
Problem
You are given a set of integers. Initially, contains , , and .
You can perform zero or more steps. On each step, you choose two elements (possibly equal) and such that and , and insert the number into the set .
You cannot perform more than 43 steps.
Your task is to get the integer in your set.
Input
The first line contains a single integer (), the number you have to get in the set.
Output
For each step, print and on a separate line. The condition must be satisfied.
The number of steps must be at most 43. You do not have to minimize it. If there are several possible solutions, print any one of them.