Melody Pond was stolen from her parents as a newborn baby by Madame Kovarian, to become a weapon of the Silence in their crusade against the Doctor. Madame Kovarian changed Melody's name to River Song, giving her a new identity that allowed her to kill the Eleventh Doctor.

Heidi figured out that Madame Kovarian uses a very complicated hashing function in order to change the names of the babies she steals. In order to prevent this from happening to future Doctors, Heidi decided to prepare herself by learning some basic hashing techniques.

The first hashing function she designed is as follows.

Given two positive integers $(x, y)$ she defines $H(x,y):=x^2+2xy+x+1$.

Now, Heidi wonders if the function is reversible. That is, given a positive integer $r$, can you find a pair $(x, y)$ (of positive integers) such that $H(x, y) = r$?

If multiple such pairs exist, output the one with smallest possible $x$. If there is no such pair, output "NO".


-----Input-----

The first and only line contains an integer $r$ ($1 \le r \le 10^{12}$).


-----Output-----

Output integers $x, y$ such that $H(x,y) = r$ and $x$ is smallest possible, or "NO" if no such pair exists.


-----Examples-----
Input
19

Output
1 8

Input
16

Output
NO

Difficulty: interview

Starter code:

Solutions:
r=int(input())
if r<=4:
    print("NO")
elif r%2==0:
    print("NO")
else :
    print(1, (r-3)//2)

n = int(input())
i = 1
while i * i < n:
    l = ( n - i*i - i - 1 )
    if l > 0 and l % (2 * i) == 0:
        print(i, l // (2 * i) )
        break
    i += 1
else:
    print("NO")


n = int(input())
if(n%2==0 or n<=3):
    print("NO")
else:
    print(1,(n-3)//2)


import math
import sys,string,bisect,heapq
input=sys.stdin.readline
from collections import deque,defaultdict
L=lambda : list(map(int,input().split()))
Ls=lambda : list(input().split())
M=lambda : list(map(int,input().split()))
I=lambda :int(input())
n=I()
if(n%2==0 or n<=3):
    print("NO")
else:
    print(1,(n-3)//2)
    



N = int(input())

num = N-1

if num<=3 or num%2==1:
    print('NO')
    quit()
    
x = 1

y = (num-2)//2

print(x,y)


r = int(input())
ans = 'NO'
for i in range(1, 3 * int(r ** .5)):
    d = r - 1 - i - i ** 2
    if d < 1:
        break
    else:
        if d % (i * 2) == 0:
            ans = (i, d // (i * 2))
            break
if ans == 'NO':
    print(ans)
else:
    print(*ans)


r = int(input())

if r%2 == 0:
    print('NO')

elif r == 1:
    print('NO')

elif r == 3:
    print('NO')
else:
    print(1, end=' ')
    print((r-3)//2)

r = int(input())
if r <= 4 or r % 2 == 0:
    print('NO')
else:
    print(1, int((r-3)/2))


n = int(input())
if n&1 and n >= 5:
    print(1, (n-5)//2 + 1)
else:
    print("NO")

#!/usr/bin/env python
r = int(input())

for x in range(1, 10**6):
    if (r - (x**2 + x + 1)) % (x << 1) == 0:
        y = (r - (x**2 + x + 1)) // (x << 1)
        if y > 0:
            print(x, y)
            break
else:
    print("NO")


def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors

def factors(n):
    super=[1]
    for i in prime_factors(n):
        super.extend([j*i for j in super])
    return list(sorted(set(super)))
    
n = int(input())
n -= 1
OK = False;
for i in factors(n):
    if((n // i - i) > 0 and (n // i - i) % 2 == 1 and i > 0 and (n // i - i)// 2 > 0):
        print("{} {}".format(i, (n // i - i)// 2))
        OK = True
        break
if(not OK):
    print("NO")

n = int(input())
n = n-1
x = int(n**0.5)
flag = True
for i in range(1, x+1):
	if(n%i==0):
		temp = n//i
		temp = temp - i - 1
		if(temp==0):
			continue
		if(temp%2==0):
			a = i
			b = temp//2
			flag = False
			break
if(flag):
	print("NO")
else:
	print(a,b)


from math import sqrt, ceil
r = int(input())
func = lambda x: (r - 1 - x - x * x) / 2 / x
for x in range(1, ceil(sqrt(r)) + 1):
    y = func(x)
    if y > 0 and y == int(y):
        print(x, int(y))
        return
print('NO')



r = int(input())

if r % 2 == 0:
  print("NO")
else:
  k = (r - 1) // 2 - 1
  if k > 0:
    print(1, k)
  else:
    print("NO")

r = int(input())
 
if (r<5 or r%2==0):
    print("NO")
    return
 
print(1, (r-3) // 2)

r = int(input())

if r >= 5:
    if r % 2 == 0:
        print('NO')
    else:
        y = int((r-3)/2)
        print(1,'',y)
else:
    print('NO')


def __starting_point():
	r = int(input())
	if r < 5:
		print("NO")
	elif r % 2 == 0:
		print("NO")
	else:
		y = (r - 3)//2
		print("1 " + str(y))

__starting_point()

import sys

def H(x,y):
    r = x*x+2*x*y+x+1
    return r

def main():
    input = sys.stdin.readline()
    r = int(input)
    x = 1
    q = r - 3
    while q > 0:
        if q % (2*x) == 0:
            y = q // (2*x)
            print(x,y)
            break
        else:
            x += 1
            q = r - 1 - x - x*x
    if q <= 0:
        print("NO")
#    return output

def __starting_point():
    main()
__starting_point()

r=int(input())
if(r%2==0 or r<=4):
 print("NO")
else:
 y=(r-3)//2
 print(1,y)

import sys
from collections import Counter
import itertools
from math import floor, ceil
 
def input():
    return sys.stdin.readline().strip()
 
def dinput():
    return int(input())
 
def tinput():
    return input().split()
 
def rinput():
    return map(int, tinput())
 
def rt(x1, x2, y3):
    print(0.5*(x2+x1))
 
def main():
    y = int(input())
    i = 1
    t = 0
    r = 1
    if y % 2 == 1 and y >= 5:
        print(1, (y - 3)//2)
    else:
        print("NO")
        
    
main()

r = int(input())
if (r > 3) and (r & 1):
    print(1, (r - 3) // 2)
else: 
    print("NO")

n=int(input())
if n%2==0:
    print("NO")
else:
    n-=1
    n-=2
    jam=int(n//2)
    if jam>0:
        print(1,jam)
    else:
        print("NO")

h = int(input())

if h % 2 == 0:
    print("NO")
    return
if h < 5:
    print("NO")
    return
else:
    print(1, (h // 2 - 1))

r = int(input())

def factorise(n):
    # n is an odd number and we've ruled out 1 already
    factors = []
    guess = 3
    while guess < n:
        exponent = 1
        while n % guess == 0:
            factors.append(guess**exponent)
            n //= guess
            factors.append(n)
            exponent += 1
        guess += 2
    return sorted(factors)

if r % 2 == 1:
    x = 1
    y = (r - 3)//2
    if y > 0:
        print(x, y)
    else:
        print("NO")
else:
    '''r -= 1
    # solve x(x + 2y + 1)
    factors = factorise(r)
    for x in factors:
        y = (-x -1 + 15/x)/2
        if y % 1 == 0:
            print(x, y)
            return
    else:'''
    print("NO")