QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22575. The Moronic Cowmpouter

Statistics

Inexperienced in the digital arts, the cows tried to build a calculating engine (yes, it's a cowmpouter) using binary numbers (base 2) but instead built one based on base negative 2! They were quite pleased since numbers expressed in base -2 do not have a sign bit.

The place values in base -2, from right to left, are 1, -2, 4, -8, 16, -32, and so on. Thus, counting from 1 goes like this: 1, 110, 111, 100, 101, 11010, 11011, 11000, 11001, and so on. Negative numbers are also represented using 1s and 0s without a sign. For example, counting down from -1 goes 11, 10, 1101, 1100, 1111, and so on.

Help the cows convert ordinary decimal integers to their base -2 representations.

Input

A single integer in the range -2,000,000,000..2,000,000,000.

Output

The input integer written in base -2, with no leading zeroes. Write 0 as exactly 0.

Examples

Input 1

-13

Output 1

110111

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.