Programming contests

DEIK Regionális Programozó Csapatverseny, egyetemi kategória, 2023. december 3.

December 3, 2023, 10:00 AM – December 3, 2023, 3:30 PM

Headstand

During the sweaty programming hours it is important to remember the importance of physical activity. But oh, my...how many lines of code we are wasting just by going to the gym?! I know! What if instead of us only the computer moves, and we just watch? Hm, yes, this will do it. Our task is to move our stiff necks by rotating numbers with 180 degrees. More precisely: we call a number an upside down number if it looks the same (on a "classic digital counter") as the original after rotating it 180 degrees. A few examples for such numbers: 181, 80108 or 69. Your task is to decide if a given number is an upside down number or not.

Input

The input is a single non-negative integer n.

Output

The output is True if n is an upside down number or False otherwise.

Restrictions

  • n is non-negative and at most 10^42 - 1

Example

Input:
  1. 80108
download as text file Output:
  1. True
download as text file
Input:
  1. 1251
download as text file Output:
  1. False
download as text file
University of Debrecen; Faculty of Informatics; v. 09/30/2024