This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
from typing import Tuple | |
def pair_negative(x: int) -> int: | |
return 2 * x if x >= 0 else -2 * x - 1 | |
def unpair_negative(z: int) -> int: | |
return int(z / 2) if z % 2 == 0 else int((z + 1) / -2) | |
def pair_szudzik(x: int, y: int) -> int: |
OlderNewer