Harryxun/stf_run huggingface dataset:
print("YES" if int(input() in [7,5,3] else "NO")

### FIXED CODE ###

print("YES" if int(input()) in [7,5,3] else "NO")
a = input()                                                                                             
b = input()

a = int(a)
b = int(b)


for c in range(1,4):
    answer = a * b * c
    mod = answer % 2
    if mod == 1:
        print('Yes')
        break
    print('No')
    break

### FIXED CODE ###

# -*- coding: utf-8 -*-

a, b = map(int, input().split())                                                                        

for c in range(1,4):
    answer = a * b * c
    mod = answer % 2  
    if mod == 1:
        print('Yes')  
        break
    print('No') 
    break
r,g = map(int, input().split())

print(g*2-r)

### FIXED CODE ###

r = int(input())
g = int(input())
print(2*g - r)
def check(T, p, n, k):
    i = 0
    
    for j in range(k):
        s = 0
       
       while(s+T[i] <= p):
            s += T[i]
            i += 1
            if i == n:
                return n
    
    return i

n, k = [int(x) for x in input().split()]
T = []
for i in range(n):
    T.append(int(input()))

left, right = 0, 100000 * 10000

while(right - left > 1):
    mid = (left + right) / 2
    if (check(mid) >= n):
        right = mid
    else:
        left = mid

print right

### FIXED CODE ###

def check(T, p, n, k):
    i = 0
    
    for j in range(k):
        s = 0
       
        while(s+T[i] <= p):
            s += T[i]
            i += 1
            if i == n:
                return n
    
    return i

n, k = [int(x) for x in input().split()]
T = []
for i in range(n):
    T.append(int(input()))

left, right = 0, 100000 * 10000

while(right - left > 1):
    mid = int((left + right) / 2)
    if (check(T, mid, n, k) >= n):
        right = mid
    else:
        left = mid

print(right)
#include<bits/stdc++.h>
// Begin Header {{{
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i,n) for(ll i=0; i<n; i++)
#define loop(i, j, n) for(ll i=j; i<n; i++)
#define all(x) (x).begin(), (x).end()
constexpr int INF  = 0x3f3f3f3f;
const long long mod=1e9+7;
const long double PI = acos(-1);
// }}} End Header

int main() {
	int n;
	double ans=0;
	cin >> n;
	rep(i,n){
		double x; string s;
		cin >> x >> s;
		if(s == "JPY") ans+=x;
		else ans+=380000*x;
	}
	printf("%.15f", ans);
	return 0;
}

### FIXED CODE ###

n = int(input())
ans = 0
for i in range(n):
    x, u = input().split()
    x = float(x)
    if u == "JPY":
        ans+=x
    else:
        ans+=x*380000
print(ans)
N,K,X,Y=[input() for _ in range(4)]
if N-K>0:    
    print(X*K+Y*(N-K))
else:
    print(X*N)

### FIXED CODE ###

list=[input() for i in range(4)]
N,K,X,Y=map(int,list)

print(X*K+Y*(N-K) if N > K else X*N)
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

cnt = 0
step = 0

for i in range(N):
    if A[step] == B[i]:
        cnt += 1
    else:
        step += 1



flag = 0

for j in range(100):
    C = B[cnt+j:]+B[:cnt+j]
    flag = 0
    for i in range(N):
        if A[i] == C[i]:
            flag = 1
            break
    if i == N-1 and flag == 0:
        break
    
    
if flag == 1:
    print('No')
else:
    print('Yes')
    print(' '.join(map(str, C)))

### FIXED CODE ###

x = int(input())
if x == 0:
    print(1)
else:
    print(0)
N = int(input())
N -= 1
D = deque(sorted(list(map(int, input().split()))))
ans = D.popleft() / (2 ** N)
while D:
  d = D.popleft()
  ans += d / (2 ** N)
  N -= 1
print(ans)

### FIXED CODE ###

from collections import deque
N = int(input())
N -= 1
D = deque(sorted(list(map(int, input().split()))))
ans = D.popleft() / (2 ** N)
while D:
  d = D.popleft()
  ans += d / (2 ** N)
  N -= 1
print(ans)
def f(n):
    if n < 2:
        return 1
    else:
        return n * f(n-2)

N = int(input())
result = str(f(N))[::-1]
print(result)

count = 0
for n in result:
    if n != 0:
        break
    else:
        count += 1
print(count)

### FIXED CODE ###

def main():
    I = int(input())

    if not I % 2 == 0:
        return 0
    
    I //= 2

    counter = 0
    while I > 0:
        I //= 5
        counter += I
    return counter

print(str(main()))
N = input()

mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1
    
print(x)

### FIXED CODE ###

N = input()
N = int(N)

mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1
    
print(x)
import numpy as np

N, M, C = [int(x) for x in input().split()]
B = np.array([int(x) for x in input().split()])
A = np.empty((N,M))

count = 0
for n in range(N):
    A[n] = [int(m) for m in input().split()]
    count += (sum(A[n] * B)+C > 0)
print(count)


### FIXED CODE ###

H, W = map(int, input().split())
h, w = map(int, input().split())

print(str(H * W - (h * W + w * H - h * w)))
a,b=map(int,input().split())
if b>=a:
  print("unsafe")
 else:
  print("safe")

### FIXED CODE ###

a,b=map(int,input().split())
if b>=a:
    print("unsafe")
else:
    print("safe")
import math

def cin():
    in_ = list(map(int,input().split()))
    if len(in_) == 1:  return in_[0]
    else:  return in_

a, b, x = cin()

if 2 * x <= a ** 2 * b:
    p = 2 * x / (a * b)
    print(math.degrees(math.atan(b / p)))
else:
    S = x / a
    p = 2 * (a * b - S) / a
    print(90 - math.degrees(math.atan(a / p)))

### FIXED CODE ###

import math

def cin():
    in_ = list(map(int,input().split()))
    if len(in_) == 1:  return in_[0]
    else:  return in_

a, b, x = cin()
if a * a * b == x:  print(0)
else:
    if 2 * x <= a ** 2 * b:
        p = 2 * x / (a * b)
        print(math.degrees(math.atan(b / p)))
    else:
        S = x / a
        p = 2 * (a * b - S) / a
        print(90 - math.degrees(math.atan(a / p)))
import sys
input_ = sys.stdin.readline
input_()
x_list = list(map(int, input_().split()))
for x in x_list:
  if x%2==0:
    a += 1

if a%2==0:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

import sys
input()
count = 0
a_list = list(map(int, input().split()))
for a in a_list:
  count += a%2

print("YES") if count%2==0 else print("NO")
import sys
sys.setrecursionlimit(10 ** 6)

n = int(input())
x = input()
z = '1' * n
o = '0' * n
X = int(x, 2)

if (z == x):
  u = n - 1
  d = n - 1
elif (o == x):
  u = 1
  d = 1
else:
  tmp = len(list(filter(lambda x: x == '1', x)))
  u = tmp + 1
  d = tmp - 1


def popcount(i):
  return i % len(list(filter(lambda x: x == '1', format(i, 'b'))))


def solve(i, count):
  if (i <= 2 * 10**5 and ans[i] != 0):
    return count + ans[i]
  elif (i == 0):
    return count
  else:
    return solve(popcount(i), count + 1)


def solve2(i, div):
  if (i <= 2 * 10**5):
    return ans[i]
  else:
    return ans[i % div] + 1


ans = [0] * (2 * 10 ** 5 + 4)
_u = (2 * 10 ** 5) // u
U = X % u + (u * _u) + u
_d = (2 * 10 ** 5) // d
D = X % d + (d * _d) * 2 + d * 2
Us = [0] * (2 * 10 ** 5)
Ds = [0] * (2 * 10 ** 5)
for i in range(1, 2 * 10 ** 5 + 4):
  ans[i] = solve(i, 0)
  
Us[0] = 1 % u
Ds[0] = 1 % d
for i in range(1, 2 * 10 ** 5):
  Us[i] = (Us[i-1] * 2) % u
  Ds[i] = (Ds[i-1] * 2) % d

for i in range(n):
  if(x[i] == '0'):
    print(solve2(U + Us[n-i-1], u))
  else:
    if (d == 0):
      print(0)
    else:
      print(solve2(D - Ds[n-i-1], d))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

n = int(input())
x = input()
z = '1' * n
o = '0' * n
X = int(x, 2)

if (n == 1 and x == '1'):
  print(0)
  exit()

if (z == x):
  u = n - 1
  d = n - 1
elif (o == x):
  u = 1
  d = 1
else:
  tmp = len(list(filter(lambda x: x == '1', x)))
  u = tmp + 1
  d = tmp - 1


def popcount(i):
  return i % len(list(filter(lambda x: x == '1', format(i, 'b'))))


def solve(i, count):
  if (i <= 2 * 10**5 and ans[i] != 0):
    return count + ans[i]
  elif (i == 0):
    return count
  else:
    return solve(popcount(i), count + 1)


def solve2(i, div):
  if (i <= 2 * 10**5):
    return ans[i]
  else:
    return ans[i % div] + 1


ans = [0] * (2 * 10 ** 5 + 4)
_u = (2 * 10 ** 5) // u
U = X % u + (u * _u) + u
if(d != 0):
  _d = (2 * 10 ** 5) // d
  D = X % d + (d * _d) * 2 + d * 2
Us = [0] * (2 * 10 ** 5)
Ds = [0] * (2 * 10 ** 5)
for i in range(1, 2 * 10 ** 5 + 4):
  ans[i] = solve(i, 0)
Us[0] = 1 % u
if(d != 0):
  Ds[0] = 1 % d
for i in range(1, 2 * 10 ** 5):
  Us[i] = (Us[i - 1] * 2) % u
  if(d != 0):
    Ds[i] = (Ds[i-1] * 2) % d

for i in range(n):
  if(x[i] == '0'):
    print(solve2(U + Us[n-i-1], u))
  else:
    if (d == 0):
      print(0)
    else:
      print(solve2(D - Ds[n-i-1], d))
def main(N, S):
    dp = [0 if n != 0 else 1 for n in range(N)] # 初期値
    lst_S = sorted(list(S))

    for i in range(N):
        if dp[i] == 0:  # 計算時間削減のため， 時間さえ間に合えば不要かも．
            continue
        for j in lst_S:
            if i + j > N - 1:
                break
            else:
                dp[i+j] = (dp[i+j] + dp[i]) % mod
    print(dp[-1])


if __name__ == '__main__':
    N, K = list(map(int, input().split()))
    S = set()
    for k in range(K):
        L, R = map(int, input().split())
        {S.add(i) for i in range(L, R+1)}
    main(N, S)

### FIXED CODE ###

mod = 998244353

# 貰うDP
def main(N, S):
    dp = [0 if n != 0 else 1 for n in range(N)]     # dp[i]はマスiに行く通り数． (答えはdp[-1]), dp[0] = 1 (最初にいる場所だから1通り)
    A = [0 if n != 0 else 1 for n in range(N)]      # dp[i] = A[i] - A[i-1] (i >= 1), A[0] = dp[0] = 1 (i = 0) が成り立つような配列を考える．

    for i in range(1, N):   # 今いる点 (注目点)
        for l, r in S:  # 選択行動範囲 (l: 始点, r: 終点)
            if i - l < 0:   # 注目点が選択行動範囲の始点より手前の場合 → 注目点に来るために使用することはできない．
                break
            else:           # 注目点に来るために使用することができる場合
                dp[i] += A[i-l] - A[max(i-r, 0)-1]  # lからrの間で，注目点に行くために使用できる点を逆算． そこに行くことができる = 選択行動範囲の値を選択することで注目点に達することができる通り数．
        dp[i] %= mod
        A[i] = (A[i-1] + dp[i]) % mod
    print(dp[-1])

if __name__ == '__main__':
    N, K = list(map(int, input().split()))
    S = {tuple(map(int, input().split())) for k in range(K)}
    S = sorted(list(S), key = lambda x:x[0])    # 始点でsort (範囲の重複がないため)
    main(N, S)
s = input()
t = input()
print (t + s)

### FIXED CODE ###

L,R = input().split()
k = R + L
print (k)
price, len_hate_set = map(int, input().split())
hate_set = set([int(i) for i in input().split()])

ans = 0

while True:
    if all(map(lambda x: int(x) in set(range(0, 10)) - hate_set, 
               [int(str(ans)[i]) for i in range(len(str(ans)))])) and ans >= price:
        print ans

    ans += 1

### FIXED CODE ###

def abc042_c():
    price, len_hate_set = map(int, input().split())
    hate_set = set([int(i) for i in input().split()])

    usable_list = list(set(range(0, 10)) - hate_set)

    ans = 0

    while True:
        if all(map(lambda x: int(x) in usable_list, [int(str(ans)[i]) for i in range(len(str(ans)))])) and ans >= price:
            return ans

        ans += 1


if __name__ == '__main__':
    print(abc042_c())
n = int(input())
a = int(input())
b = int(input())
if n == 1:
  print("Hello World")
else:
  print(a+b)

### FIXED CODE ###

n = int(input())
if n == 1:
  print("Hello World")
  quit()
elif n==2:
  a = int(input())
  b = int(input())
  print(a+b)
import sys
N, Q = [int(i) for i in input().split()]
tree = [[] for i in range(N)]
cost_ls = [0 for i in range(N)]
for i in range(N-1):
    a, b = [int(i) for i in sys.stdin.readline().split()]
    a -= 1
    b -= 1
    tree[a].append(b)
    tree[b].append(a)

yet = set()
def plus(node, num):
    yet.add(node)
    cost_ls[node] += num
    if len(tree[node]) == 0:
        return
    for child in tree[node]:
        if child in yet:
            continue
        plus(child, cost_ls[node])

for i in range(Q):
    p, x = [int(i) for i in sys.stdin.readline().split()]
    cost_ls[p-1] += x

plus(0, 0)

print(" ".join([str(cost) for cost in cost_ls]))

### FIXED CODE ###

import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)

N, Q = map(int, input().split())
V = {i: [] for i in range(1, N + 1)}
for _ in range(N - 1):
    a, b = map(int, input().split())
    V[a].append(b)
    V[b].append(a)

C = {i: 0 for i in range(1, N + 1)}

for _ in range(Q):
    p, x = map(int, input().split())
    C[p] += x


def propagate(u, p):
    for v in V[u]:
        if v == p:
            continue
        C[v] += C[u]
        propagate(v, u)


propagate(1, 0)

print(' '.join(str(C[i]) for i in range(1, N + 1)))
alphabet = [chr(i) for i in range(ord('a'), ord('z')+1)]
s = ""
while True:
	n = raw_input().lower()
	if n == "":
		break
	s += n
for i in range(26):
	count = s.count(alphabet[i])
	print("{0} : {1}").format(alphabet[i],count)

### FIXED CODE ###

alphabet = [chr(i) for i in range(ord('a'), ord('z')+1)]
s = ""
while True:
	try:
		s += raw_input().lower()
	except EOFError:
		break
for i in range(26):
	count = s.count(alphabet[i])
	print("{0} : {1}").format(alphabet[i],count)
if __name__ == "__main__":
    S = input()
    ans = 0
    bcount = 0
    for i in range(len(S)):
        if S[i] == 'B':
            bcount += 1
        else:
            ans += bcount
​
    print(ans)

### FIXED CODE ###

S = list(input())

#print(S)

n = 1 if S[0] == "W" else 0# number of white string
count = 0
for i in range(1, len(S)):
    if S[i] == "W":
        count += i - n
        n += 1
        #print("n is", n)
        #print("count is ", count)
print(count)
import numpy as np
n = int(input())
#l = [ i+1 for i in range(n) ]
p = [i+1 for i in range(n)]
p.append(1)
p.pop(0)
p_array = np.array(p)
#print(sum(l % p_array))
print(sum(p_array - 1))

### FIXED CODE ###

n = int(input())
print(n*(n-1)//2)
n, k = map(int, input().split())
if n <= k:
  print(0)
elif k == 0:
  print(sum(h))
else:
  h = sorted(list(map(int, input().split())))
  print(sum(h[:n-k]))

### FIXED CODE ###

n, k = map(int, input().split())
h = list(map(int, input().split()))
if n <= k:
  print(0)
elif k == 0:
  print(sum(h))
else:
  h = sorted(h)
  print(sum(h[:n-k]))
import fractions
n = int(input())
a = list(map(int,input().split()))
for N in range(n - 1):
    a[N + 1] = math.gcd(a[N],a[N + 1])
print(a[n - 1])

### FIXED CODE ###

import fractions
n = int(input())
a = list(map(int,input().split()))
for N in range(n - 1):
    a[N + 1] = fractions.gcd(a[N],a[N + 1])
print(a[n - 1])
import sys
input = sys.stdin.readline
n = int(input())
abd = [list(map(int,input().split())) for i in range(n-1)]
if n == 2:
  print(abd[0][2])
  exit()
graph = [[] for i in range(n+1)]
deg = [0 for i in range(n+1)]
for a,b,d in abd:
  graph[a].append((b,d))
  graph[b].append((a,d))
  deg[a] += 1
  deg[b] += 1
stack = []
root = 0
dp = [1 for i in range(n+1)]
for i in range(1,n+1):
  if deg[i] == 1:
    stack.append(i)
  elif root == 0:
    root = i
    deg[i] += 1
ans = 0
flg = 0
while stack:
  x = stack.pop()
  for y,d in graph[x]:
    if deg[y] > 1:
      dp[y] += dp[x]
      if dp[x] == n-dp[x]:
        flg = 1
        ans += (dp[x]*2-1)*d
      else:
        ans += min(dp[x],n-dp[x])*2*d
      deg[y] -= 1
      if deg[y] == 1:
        stack.append(y)
if not flg:
  print(2/0)
  dmn = min(list(zip(*abd))[2])
  ans -= dmn
print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import defaultdict
n = int(input())
abd = [list(map(int,input().split())) for i in range(n-1)]
if n == 2:
  print(abd[0][2])
  exit()
graph = [[] for i in range(n+1)]
deg = [0 for i in range(n+1)]
for a,b,d in abd:
  graph[a].append((b,d))
  graph[b].append((a,d))
  deg[a] += 1
  deg[b] += 1
stack = []
root = 0
dp = [[] for i in range(n+1)]
sm = [1 for i in range(n+1)]
mx = [0 for i in range(n+1)]
for i in range(1,n+1):
  if deg[i] == 1:
    stack.append(i)
  elif root == 0:
    root = i
    deg[i] += 1
ans = 0
flg = 0
while stack:
  x = stack.pop()
  if dp[x]:
    sm[x] += sum(dp[x])
  if sm[x]*2 == n:
    flg = 1
  for y,d in graph[x]:
    if deg[y] > 1:
      dp[y].append(sm[x])
      if sm[x] == n-sm[x]:
        ans += (sm[x]*2-1)*d
      else:
        ans += min(sm[x],n-sm[x])*2*d
      deg[y] -= 1
      if deg[y] == 1:
        stack.append(y)
dmn = 10**18
if not flg:
  for a,b,d in abd:
    for v in (a,b):
      if not mx[v]:
        if dp[v]:
          mx[v] = max(max(dp[v]),n-1-sm[v])
        else:
          mx[v] = n-2
    if min(mx[a],mx[b])*2 < n:
      dmn = min(dmn,d)
  ans -= dmn
print(ans)
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    L, R = input_nums()
    MOD = 2019
    a = L%MOD
    b = R%MOD
    if a < b and R - L < 2019:
        print((a*(a+1))%MOD)
    else:
        print(0)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
## io
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))
## dp
INIT_VAL = 0
DP2 = lambda d1,d2: [[INIT_VAL]*d2 for _ in range(d1)]
DP3 = lambda d1,d2,d3: [[[INIT_VAL]*d3 for _ in range(d2)] for _ in range(d1)]

def main():
    n = II()
    aa = MII()
    total = sum(aa)
    x1 = total - 2*sum(aa[1::2])
    ans = [x1]
    for i in range(0, n-1):
        ans.append(2*aa[i]-ans[-1])
    print(*ans)


if __name__ == '__main__':
    main()
def com():
????x = raw_input()
????a = len(x)
  y = raw_input()
????b = len(y)

????k1 = [0 for i in range(b+1)]
????
????for i in range(a):
????????k2 = k1 + [ ]
????????for j in range(b):
????????????if k1[j+1] < k1[j]:
???????????????? k1[j+1] = k1[j]
????    elif x[i] == y[j]:
????????????????    k1[j+1] = k2[j] + 1
??????????return k1[-1]

n = input()
for l in range(n):
????print com()

### FIXED CODE ###

def common():
  X = raw_input()
  Y = raw_input()
  a = len(X)
  b = len(Y)
  k1 = [0 for i in range(b+1)]
 
  for i in range(a):
     k2 = k1 + []
     for j in range(b):
       if X[i] == Y[j]:
          k1[j+1] = k2[j] + 1
       elif k1[j+1] < k1[j]:
          k1[j+1] = k1[j]
 
  return k1[-1]
 
n = input()
for l in range(n):
  print common()
from math import sqrt
n, d = map(int,input().split())
a = [map(int,input().split()) for _ in range(n)]
cnt = 0
for i in range(n):
  if pow(d,2) >= pow(a[i][0],2) + pow(a[i][1],2):
    cnt += 1
print(cnt)

### FIXED CODE ###

n,d = map(int,input().split())
cnt = 0
for i in range(n):
  a,b =map(int,input().split())
  if pow(d,2) >= pow(a,2) + pow(b,2):
  	cnt += 1
print(cnt)
N, K = map(int, input().split())
A_i = list(map(int, input().split()))

place = 1
road = [0 for i in range(N)]
cycle = 0

road[0] = 1

while K != 0:
    place = A_i[place - 1]
    K -= 1

    if road[place - 1] == 1:
        loop_place = place
        break
    road[place - 1] = 1

while 1:
    loop_place = A_i[loop_place - 1]
    cycle += 1

    if place == loop_place:
        break

K = K % cycle

while K != 0:
    place = A_i[place - 1]
    K -= 1

print(place)


### FIXED CODE ###

N, K = map(int, input().split())
A_i = list(map(int, input().split()))

place = 1
road = [0 for i in range(N)]
cycle = 0

road[0] = 1

while K != 0:
    place = A_i[place - 1]
    K -= 1
    if road[place - 1] == 1:
        loop_place = place
        break
    road[place - 1] = 1

while K != 0:
    loop_place = A_i[loop_place - 1]
    cycle += 1

    if place == loop_place:
        break

if cycle != 0:
    K = K % cycle

while K != 0:
    place = A_i[place - 1]
    K -= 1

print(place)
nm = lambda : map(int,input().split())
nl = lambda : list(nm())
import heapq as h

n,m,l = nm()
g = [list() for _ in range(n+1)]
ans = [0]
for _ in range(m):
    a,b,c = nm()
    g[a].append((b,c))
    g[b].append((a,c))
q = int(input())

def move(tup,cost):
    if tup[1] + cost > 0:
        if l < cost:
            return -1
        return (tup[0]+1,cost-l)
    return (tup[0],tup[1]+cost)

for st in range(1,n+1):
    dist = [-1]*(n+1)
    que = [((0,-l),st)]
    while que:
        tup,v = h.heappop(que)
        if dist[v] != -1 and dist[v] < tup:
            continue
        dist[v] = tup
        for x,c in g[v]:
            new = move(tup,c)
            if dist[x] == -1 or dist[x] > new:
                h.heappush(que,(new,x))
    ans.append(dist)

for _ in range(q):
    s,t = nm()
    if ans[s][t] == -1:
        print(-1)
    else:
        print(ans[s][t][0])

### FIXED CODE ###

n,m,l = map(int,input().split())
g = [[1<<30]*n for _ in range(n)]
for _ in range(m):
  a,b,c = map(int,input().split())
  g[a-1][b-1] = c
  g[b-1][a-1] = c
for i in range(n):
  g[i][i] = 0

def bell(g,n):
  for k in range(n):
    for i in range(n-1):
      for j in range(i+1,n):
        if g[i][j] > g[i][k] + g[k][j]:
          g[i][j] = g[i][k] + g[k][j]
          g[j][i] = g[i][j]
  return g

g = bell(g,n)
for i in range(n):
  for j in range(n):
    if i == j:
      g[i][j] = 0
    elif g[i][j] <= l:
      g[i][j] = 1
    else:
      g[i][j] = 1<<30
g = bell(g,n)

q = int(input())
for _ in range(q):
  s,t = map(int,input().split())
  if g[s-1][t-1]>>30:
    print(-1)
  else:
    print(g[s-1][t-1]-1)
# D - AtCoder Express 2

import bisect, copy

N, M, Q = map(int, input().split())
LRidx = [list(map(int, input().split())) + [i] for i in range(M)]
p, q = [], []
for _ in range(Q):
    tmp_p, tmp_q = map(int, input().split())
    p.append(tmp_p)
    q.append(tmp_q)

# 探索結果をメモしておく
LRidx = sorted(LRidx, key = lambda x: x[0])
tmp_L = [LRidx[idx][0] for idx in range(M)]
l_memo = [[-1] for _ in range(M+1)]
l_ok_idx = [[] for _ in range(Q)]
for i in range(Q):
    b_idx = bisect.bisect_left(tmp_L, p[i])
    if l_memo[b_idx][0] == -1:
        try:
            tmp = []
            for j in range(bisect.bisect_left(tmp_L, p[i]), M):
                tmp.append(LRidx[j][2])
            l_ok_idx[i] = copy.deepcopy(tmp)
            l_memo[b_idx] = copy.deepcopy(tmp)
        except:
            pass
    else:
        l_ok_idx[i] = copy.deepcopy(l_memo[b_idx])
    
LRidx = sorted(LRidx, key = lambda x: x[1])
tmp_R = [LRidx[idx][1] for idx in range(M)]
r_memo = [[-1] for _ in range(M+1)]
r_ok_idx = [[] for _ in range(Q)]
for i in range(Q):
    b_idx = bisect.bisect_right(tmp_R, q[i])
    if r_memo[b_idx][0] == -1:
        tmp = []
        for j in range(b_idx):
            tmp.append(LRidx[j][2])
        r_ok_idx[i] = copy.deepcopy(tmp)
        r_memo[b_idx] = copy.deepcopy(tmp)
    else:
        r_ok_idx[i] = copy.deepcopy(r_memo[b_idx])
    
for i in range(Q):
    print(len(set(l_ok_idx[i]) & set(r_ok_idx[i])))

### FIXED CODE ###

# D - AtCoder Express 2

import numpy as np

N, M, Q = map(int, input().split())
LR = np.zeros((N+1, N+1))

for _ in range(M):
    l, r = map(int, input().split())
    LR[l,r] += 1

np.cumsum(LR, axis = 0, out = LR)
np.cumsum(LR, axis = 1, out = LR)
    
for _ in range(Q):
    p, q = map(int, input().split())
    print(int(LR[q,q] - LR[p-1,q] - LR[q,p-1] + LR[p-1,p-1]))
l,r,d = map(int,input.split())
print((l-r+1) // d)


### FIXED CODE ###

l,r,d = map(int,input().split())
print(r//d - (l-1)//d)
print(input().insert(4,' '))

### FIXED CODE ###

s = input()
print(s[:4] + ' ' + s[4:])
A,B,C=map(int,input().split())
print(min(int(B/A),C)

### FIXED CODE ###

A,B,C=map(int,input().split())
print(min(int(B/A),C))
N = input()

list = [i for i in range(1, N+1) if  (i % 3 != 0 or i % 5 !=0)]
print(sum(list))

### FIXED CODE ###

N = int(input())

list = [i for i in range(1, N+1) if not (i % 3 == 0 or i % 5 ==0)]

print(sum(list))