Harryxun/stf_run huggingface dataset:
N,M=(int(x) for x in input().split())
a=[int(input()) for i in range(M)]

x=[0]*(N+1)
x[0]=1
x[1]=1 if not 1 in a else 0

for i in range(2,N+1): 
    if not i in a:
        x[i]=x[i-1]+x[i-2]

print(int(x[N]%((1e+9)+7)))

### FIXED CODE ###

N,M=(int(x) for x in input().split())
a=[int(input()) for i in range(M)]

x=[0]*(N+1)
j=0
if N!=0:
    x[0]=1
if N>1 and M!= 0 and a[0]==1:
    j+=1
else:
    x[1]=1

for i in range(2,N+1): 
    if j==M or i!=a[j]:
        x[i]=x[i-1]+x[i-2]
    else:
        x[i]=0
        j+=1
print(int(x[N]%(1000000007)))
n = int(input())
s = input()

def z_algorythm(s):
    n = len(s)
    LCP = [0]*n
    i = 1
    j = 0
    c = 0
    for i in range(1, n):
        if i + LCP[i-c] < c + LCP[c]:
            LCP[i] = LCP[i-c]
        else:
            j = max(0, c+LCP[c]-i)
            while i+j < n and s[j] == s[i+j]:
                j += 1
                LCP[i] = j
                c = i
    LCP[0] = n
    return LCP

ans = 0
for i in range(n):
    LCP = z_algorythm(s[i:])
    for j, len in enumerate(LCP):
        tmp = min(len, j)
        ans = max(ans, tmp)
print(ans)

### FIXED CODE ###

N = int(input())
S = input()
ok, ng = 0, N + 1
while abs(ok - ng) > 1:
    x = (ok + ng) // 2
    check = set()
    for i in range(N - x + 1):
        check.add(S[i: i + x])
        if S[i + x: i + 2 * x] in check:
            ok = x
            break
    else:
        ng = x

print(ok)
N,D = [int(i) for i in input().split()]
for i in range(N):
    lagd.append([int(i) for i in input().split()])
lngs = D - 1
def kyoricac(daone,datwo,d):
    keka = []
    n = 0
    wa = 0
    while n <= d:
        wa = (daone[n] - datwo[n])**2
        keka += [wa]
        n += 1
    wa = sum(keka)
    kaesi = float(wa ** (1/2))
    return kaesi
ans = 0
fst = 1
for i in range(N):
    for n in range(fst,N):
        flag = float(kyoricac(lagd[i],lagd[n],lngs))
        if flag.is_integer() == True:
            ans += 1
    fst += 1
print(ans)

### FIXED CODE ###

N,D = [int(i) for i in input().split()]
lagd = []
for i in range(N):
    lagd.append([int(i) for i in input().split()])
lngs = D - 1
def kyoricac(daone,datwo,d):
    keka = []
    n = 0
    wa = 0
    while n <= d:
        wa = (daone[n] - datwo[n])**2
        keka += [wa]
        n += 1
    wa = sum(keka)
    kaesi = float(wa ** (1/2))
    return kaesi
ans = 0
fst = 1
for i in range(N):
    for n in range(fst,N):
        flag = float(kyoricac(lagd[i],lagd[n],lngs))
        if flag.is_integer() == True:
            ans += 1
    fst += 1
print(ans)
while True :
    (x,y) = [int(i) for i in input().split()]
    if 0 = x and 0 = y:
        break
    elif x <= y:
        print(x,y)
    else :
        print(y,x)

### FIXED CODE ###

while True:
    (x, y) = [int(i) for i in input().split()]
    
    if x == y == 0 :
        break

    if x <= y :
        print(x, y)
    else :
        print(y, x)
data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]

count = int(input())
for c in range(count):
    c, f, r, v = [int(i) for i in input().split()]
    data[b - 1][f - 1][r - 1] += v
    

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
    
        print()

    if bi < 3:
        print('#' * 20)

### FIXED CODE ###

data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]
    
count = int(input())
for c in range(count):
    b,f,r,v = [int(i) for i in input().split()]
    data[b-1] [f-1] [r-1] += v
    
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
        print()
    if bi < 3:
        print('#' * 20)
import sys;input=sys.stdin.readline
from bisect import*

n,q=map(int,input().split())
event=[]
stopped={-1}

def doevent(l):
    global stopped
    if l[1]==1:
        if stopped=={-1}:
            stopped=set()
        stopped.add(l[2])
    elif l[1]==-1:
        stopped.remove(l[2])
        if len(stopped)==0:
            stopped={-1}
            
for i in range(n):
    s,t,x=map(int,input().split())
    event.append((s-x,1,x))
    event.append((t-x,-1,x))
event.append((-float("inf"),"x","x"))
event.append((float("inf"),"x","x"))
event.sort(key=lambda x:x[0])
eventtime=[i[0]for i in event]
#print(eventtime)
query=[bisect_right(eventtime,int(input()))-1 for i in range(q)]+[float("inf")]
#print(query)
c=0
#print(event)
for i in range(2*n):
    doevent(event[i])
    while i==query[c]:
        print(min(stopped))
        c+=1
for i in range(query.count(2*n)):
    print(-1)

### FIXED CODE ###

import sys;input=sys.stdin.readline

n,q=map(int, input().split())
event=[]
for _ in range(n):
    s,t,x=map(int,input().split())
    event.append((s-x-0.5,1,x))
    event.append((t-x-0.5,-1,x))
for i in range(q):
    event.append((int(input()),0,i))
    
event.sort()
is_stop=False
stop=set()
minstop=float('inf')
ans=[-1]*q
for t,e,x in event:
    if e > 0:
        stop.add(x)
        if x<minstop:
            minstop=x
            is_stop=True
    elif e<0:
        stop.remove(x)
        if minstop==x:
            is_stop=False
    elif len(stop)>0:
        if not is_stop:
             minstop=min(stop)
             is_stop=True
        ans[x]=minstop
        
print('\n'.join(map(str, ans)))
n = int(input())

count = 0
for i in range(n):
    if i4 % 2 == 0:
        count = count + 1
print(count/n)

### FIXED CODE ###

n = int(input())

count = 0
for i in range(n):
    if i % 2 == 0:
        count = count + 1
print(count/n)
a,b = map(int, input().split())

if a > b:
  print a,">",b
if a < b:
  print a,"<",b
if a == b:
  print a, "==", b

### FIXED CODE ###

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

if a > b:
  print 'a > b'
if a < b:
  print 'a < b'
if a == b:
  print 'a == b'
import sys
import itertools
readline = lambda:sys.stdin.readline().rstrip()
N,K = readline().split()
dd = {int(s) for s in readline().split()}
table = [None] * 10
a = 10
for i in range(9,-1,-1):
    if i not in dd:
        a = i
    table[i] = a

nn = [int(n) for n in N]
mm = [table[n] for n in nn]
tab_min = min(x for x in table if x>0)
tab_zero = table[0]
        
if mm[0]==10:
    print(tab_min, end='')
    for z in itertools.repeat(tab_zero, len(mm)-1):
        print(z, end='')
else:
    for z,c in zip(mm, mm[1:]+[0]): 
        if c==10:
            print(min(tab_min, z), end='')
        elif z==10:
            print(tab_zero, end='')
        else:
            print(z, end='')
print()

### FIXED CODE ###

import sys
readline = lambda:sys.stdin.readline().rstrip()
a,b,c = sorted(map(int, readline().split()))
ans = 'YES' if a==b==5 and c==7 else 'NO'
print(ans)
from itertools import permutations

N, M = [int(i) for i in input().split()]
adjacent = [[0] * N for _ in range(N)]
for _ in range(N):
    a, b = [int(i) for i in input().split()]
    adjacent[a - 1][b - 1] = 1
    adjacent[b - 1][a - 1] = 1

ans = 0
for p in permutations(range(N), r=N):
    if p[0] != 0:
        continue
    for i in range(1, N):
        f, t = p[i-1:i+1]
        if adjacent[f][t] != 1:
            break
    else:
        ans += 1
print(ans)


### FIXED CODE ###

import itertools


def main():
    n, m = [int(i) for i in input().split()]
    path_matrix = [[False] * n for _ in range(n)]
    for _ in range(m):
        a, b = [int(i) for i in input().split()]
        a -= 1
        b -= 1
        path_matrix[a][b] = True
        path_matrix[b][a] = True

    ans = 0
    for path in itertools.permutations(range(n), n):
        if path[0] != 0:
            continue
        for i in range(n):
            if i == n - 1:
                ans += 1
                break
            if not path_matrix[path[i]][path[i+1]]:
                break

    print(ans)


if __name__ == "__main__":
    main()
n = int(input())
a = 0
b = n
total = []

def digitSum(number):
    sum = 0
    while number > 0:
        sum += number % 10
        number //= 10
    return sum

for i in range(3, n + 1):
    a = i
    b = n - a
    if b < a:
        break
    total.append(digitSum(a) + digitSum(b))
print(min(total))

### FIXED CODE ###

n = int(input())
a = 0
b = n
total = []

def digitSum(number):
    sum = 0
    while number > 0:
        sum += number % 10
        number //= 10
    return sum

for i in range(1, n + 1):
    a = i
    b = n - a
    if b < a:
        break
    total.append(digitSum(a) + digitSum(b))
print(min(total))
n = int(input())
p = list(map(int, input().split()))

c = 0
for i in range(n-2):
    a = p[i:i+3]
    b = sorted.(a)
    if a[1] == b[1]:
        c += 1
print(c)


### FIXED CODE ###

n = int(input())
p = list(map(int, input().split()))

c = 0
for i in range(n-2):
    a = p[i:i+3]
    b = sorted(a)
    if a[1] == b[1]:
        c += 1
print(c)
n = int(input())
n2 = n/2
v = [int(i) for i in input().split()]
v1 = []
v2 = []
for i in range(n):
    if(i % 2 == 1):
        v2.append(v[i])
    else:
        v1.append(v[i])
count1 = [v1.count(v1[i]) for i in range(int(n2))]
count2 = [v2.count(v2[i]) for i in range(int(n2))]
if(v1[count1.index(max(count1))] == v2[count2.index(max(count2))]):
    count2 = list(set(count2))
    count2.sort()
    print(int(n - max(count1) - count2[1]))
else:
    print(int(n - max(count1) - max(count2)))


### FIXED CODE ###

from collections import Counter

n = int(input())
v = [int(i) for i in input().split()]
v1 = Counter(v[::2])
v2 = Counter(v[1::2])
v1mc = v1.most_common()
v2mc = v2.most_common()
if(v1mc[0][0] == v2mc[0][0]):
    if(len(v1mc) == 1 and len(v2mc) == 1):
        print(int(n/2))
    elif(len(v1mc) == 1):
        print(n - (v1mc[0][1]+v2mc[1][1]))
    elif(len(v2mc) == 1):
        print(n - (v2mc[0][1]+v1mc[1][1]))
    else:
        print(n - max(v1mc[0][1]+v2mc[1][1], v2mc[0][1]+v1mc[1][1]))
else:
    print(n - (v1mc[0][1]+v2mc[0][1]))
N, K = map(int, input().split())
A = list(map(int, input().split()))

cumAm1 = [1] + A
for i in range(1, N + 1):
    cumAm1[i] = (-1 + cumAm1[i - 1] + cumAm1[i]) % K

counts = [0] * K
counts2 = [0] * K
for i in range(N + 1):

    if i >= K:
        counts[cumAm1[i - K]] -= 1

    cur = cumAm1[i]
    counts2[cur] += counts[cur]

    counts[cur] += 1

print(sum(counts2))

### FIXED CODE ###

from collections import Counter

N, K = map(int, input().split())
A = list(map(lambda s: int(s) % K, input().split()))

cumAm1 = [1] + A
for i in range(1, N + 1):
    cumAm1[i] = (-1 + cumAm1[i - 1] + cumAm1[i]) % K

counts = Counter()
ans = 0
for i in range(N + 1):

    if i >= K:
        counts[cumAm1[i - K]] -= 1

    cur = cumAm1[i]
    ans += counts[cur]

    counts[cur] += 1

print(ans)
r = int(input())
a = r * r * 3.14159265
l = r * 2 * 3.14159265
print('{:0.8} {:0.8}'.format(a, l))


### FIXED CODE ###

r = float(input())
pi = 3.14159265359
a = r * r * pi
l = r * 2 * pi
print('{:f} {:f}'.format(a, l))
n,k = map(int, input().split())
Tree = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    Tree[a-1].append(b-1)
    Tree[b-1].append(a-1)
#print(Tree)

mod = 10**9+7
def dfs(cur, pre):
    ret = 1
    nodecnt = 0 if pre == -1 else 1

    for nd in Tree[cur]:
        #print("現在のnode:",nd)
        if nd == pre: continue
        nodecnt += 1
        ret = ret*(k-nodecnt)
        ret %= mod
        ret = ret*dfs(nd, cur)
    return ret%mod

print(k*dfs(0,-1)%mod)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100005)
n,k = map(int, input().split())
Tree = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    Tree[a-1].append(b-1)
    Tree[b-1].append(a-1)
#print(Tree)

mod = 10**9+7
def dfs(cur, pre):
    ret = 1
    nodecnt = 0 if pre == -1 else 1
    if cur > n-1 or cur < 0: return 0
    for nd in Tree[cur]:
        #print("現在のnode:",nd)
        if nd == pre: continue
        nodecnt += 1
        ret = ret*(k-nodecnt)%mod
        ret = ret*dfs(nd, cur)%mod
    return ret%mod

print(k*dfs(0,-1)%mod)
s=list(input())
n=len(s)
D=[s[0]]
s.pop(0)
while len(s)>0:
  if len(D[-1])==2 or (D[-1]!=s[0] and (len(s)==1 or s[0]!=s[1])):
    D.append(s[0])
    s.pop(0)
  else:
    D.append(s[0]+s[1])
    s.pop(0)
    s.pop(0)

print(len(D))

### FIXED CODE ###

s=list(input())
D=[s[0]]
i=0
while i < len(s) - 1:
  if s[i+1] == D[-1]:
    D.append(s[i+1:i+3])
    i+=2
  else:
    D.append(s[i + 1])
    i+=1

print(len(D)-(1 if i == len(s) else 0))
age,fee=map(int,input().split())

if age>=13:
    print(fee)
elif age<13 and age>=6:
    print(int(fee/2))
else:
    prrint(0)


### FIXED CODE ###

age,fee=map(int,input().split())

if age>=13:
    print(fee)
elif age<13 and age>=6:
    print(int(fee/2))
else:
    print(0)
import math

r = int(input())
x = math.pi

print(x*r**2 + " "+  2x**r)


### FIXED CODE ###

import math
x = math.pi

r = float(input())
print("{} {}".format(x*r*r,2*x*r))
class BigCombination(object):
    __slots__ = ["mod", "factorial", "inverse"]

    def __init__(self, mod: int = 10**9+7, max_n: int = 10**6):
        fac, inv = [1], []
        fac_append, inv_append = fac.append, inv.append

        for i in range(1, max_n+1):
            fac_append(fac[-1] * i % mod)

        inv_append(pow(fac[-1], mod-2, mod))

        for i in range(max_n, 0, -1):
            inv_append(inv[-1] * i % mod)

        self.mod, self.factorial, self.inverse = mod, fac, inv[::-1]

    def get_combination(self, n, r):
        return self.factorial[n] * self.inverse[r] * self.inverse[n-r] % self.mod

    def get_permutation(self, n, r):
        return self.factorial[n] * self.inverse[n-r] % self.mod
import math
Big = BigCombination()
n,k = map(int,input().split())
s = 0
for i in range(k):
    if n - k + 1 < i + 1:
      	print('0')
      	continue
	print((Big.get_combination(n-k+1,i+1) *Big.get_combination(k-1,i))%(10**9+7))



### FIXED CODE ###

class BigCombination(object):
    __slots__ = ["mod", "factorial", "inverse"]

    def __init__(self, mod: int = 10**9+7, max_n: int = 10**6):
        fac, inv = [1], []
        fac_append, inv_append = fac.append, inv.append

        for i in range(1, max_n+1):
            fac_append(fac[-1] * i % mod)

        inv_append(pow(fac[-1], mod-2, mod))

        for i in range(max_n, 0, -1):
            inv_append(inv[-1] * i % mod)

        self.mod, self.factorial, self.inverse = mod, fac, inv[::-1]

    def get_combination(self, n, r):
        return self.factorial[n] * self.inverse[r] * self.inverse[n-r] % self.mod

    def get_permutation(self, n, r):
        return self.factorial[n] * self.inverse[n-r] % self.mod
import math
Big = BigCombination()
n,k = map(int,input().split())
s = 0
for i in range(k):
    if n - k + 1 < i + 1:
      	print('0')
      	continue
    print((Big.get_combination(n-k+1,i+1) *Big.get_combination(k-1,i))%(10**9+7))
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

hasuu = [item % 10 if item % 10 != 0 
         for item in [A, B, C, D, E]]

for item in [A, B, C, D, E]:
  if item % 10 == 0:
    result += item 
  else:
    result += (item // 10 + 1) * 10
    
result = int(result - 10 + min(hasuu))
print(result)
    

    

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

result = 0

hasuu = [item % 10 for item in [A, B, C, D, E] if item % 10 != 0]

for item in [A, B, C, D, E]:
  if item % 10 == 0:
    result += item 
  else:
    result += (item // 10 + 1) * 10
    
if hasuu != []:
  result = int(result - 10 + min(hasuu))

print(result)
n = int(input())
a = list(map(int, input().split()))
count = 0
while all[i%2==0 for i in a]:
  a = [i//2 for i in a]
  count += 1
print(count)

### FIXED CODE ###

n = int(input())
a = map(int, input().split())
m = float('inf')
for i in a:
  count = 0
  while i%2 == 0:
    i = i//2
    count += 1
  m = min(m, count)
  if m==0:
    break
print(m)
a,b = map(int,input().split())

c = [int(_) for i in input().split()]

l = []
for i in range(a):
    l += [c[i]]
    for j in range(i+1,a):
        l += [l[-1] + c[j]]
print(l)
co = 0
la = 0
for i in range(40,-1,-1):
	for j in range(len(l)):
		if l[j] & (la + 2 ** i) == (la + 2 ** i):
			co += 1
	if co >= b:
		la += (2 ** i)
	co = 0

print(la)


### FIXED CODE ###

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

c = list(map(int,input().split()))

aa = []
aa.append(0)
aa.append(c[0])

l = []
for i in range(1,a):
	aa.append(aa[i]+c[i])
d = 0
p = len(aa)
for i in range(p):
	for j in range(i+1,p):
		l.append(aa[j]-aa[i])
co = 0
la = 0
for i in range(40,-1,-1):
	for j in range(len(l)):
		if l[j] & (la + 2 ** i) == (la + 2 ** i):
			co += 1
	if co >= b:
		la += (2 ** i)
	co = 0

print(la)
def prime_number(x):
    if x==2 or x==3:
        return True
    else:
        if x&2==0 or x%3==0:
            return False
        else:
            divisor_lst = [1,x]
            for i in range(1,x+1):
                if i%2!=0 and i%3!=0:
                    if i not in divisor_lst and x%i==0:
                        return False
                        break
            else:
                return True

n = int(input())

if prime_number(n):
    print(n-1)
else:
    i = 1
    j = n//i
    divisor_lst = []
    while i<=j:
        i += 1
        j = n//i
        if n%i==0:
            divisor_lst.append([i,j])

    n_x = divisor_lst[-1][0]
    n_y = divisor_lst[-1][1]
    print(n_x+n_y-2)

### FIXED CODE ###

n = int(input())

need_lst = []
for i in range(1,int(n**(1/2)+1)):
    if n%i==0:
        need = i+n//i
        need_lst.append(need-2)

print(min(need_lst))
#include<stdio.h>
#include<bits/stdc++.h>
 
#define get(a, i, j) *((*(a+i))+j)
 
typedef long long ll;
 
int N;
ll W, rec[101][2], mem[105][100005];
 
ll dp(int pos, ll cw); // cw = cumulative weight
 
int main()
{
    //freopen("input.txt", "r", stdin);
    memset(mem, -1, sizeof(mem));
 
    int i;
    scanf("%d%lld", &N, &W);
 
    for(i=0; i<N; ++i) scanf("%lld%lld", &get(rec, i, 0), &get(rec, i, 1));
 
    ll v1;
    v1 = dp(0, 0);
    //v2 = dp(0, 0);
 
    printf("%lld\n",v1);
 
    return 0;
}
 
 
ll dp(int pos, ll cw)
{
    //printf("Inside dp with pos = %d & cw = %lld\n", pos, cw);
    if(pos >= N || cw > W) {
        //printf("returning 0\n\n");
        return 0;
    }
    if(get(mem, pos, cw) > -1) {
        //printf("returning %lld from mem\n\n", get(mem, pos, cw));
        return get(mem, pos, cw);
    }
 
    ll w = get(rec, pos, 0);
 
    ll v1 = 0, v2 = 0;
 
    if((cw + w <= W ) ) {
        //printf("going to next pos including weight\n");
        v1 = get(rec, pos, 1);
        v1 += dp(pos+1, cw + w);
    }
 
    //printf("going to next pos excluding weight\n");
    v2 = dp(pos+1, cw);
 
 
    //printf("returning value either %lld or %lld\n\n", v1, v2);
    return get(mem, pos, cw) = (v1>v2)? v1:v2;
}

### FIXED CODE ###

def main():
  import numpy as np
  N,W = map(int, input().split())
  
  dp = np.zeros(W+1, dtype=np.int64)
  
  for _ in range(N):
    w,v = map(int,input().split())
    np.maximum(dp[:-w]+v,dp[w:], out=dp[w:])
  
  print(dp[-1])

if __name__ == '__main__':
  main()
n = int(input())
P = [int(x) for x in input().split()]

counter = 1
for i in range(1,n):
    if [x for x in P[0:i] if P[i]>x ] == []:
        counter +=1

print(counter)

### FIXED CODE ###

n, m = [int(x) for x in input().split()]

if n==m :
    print('Yes')
else:
    print('No')
li = input().split()
if li[0] * li[1] % 2 == 0:
    print("Even")
else:
    print("Odd")

### FIXED CODE ###

li = input().split()
a = int(li[0])
b = int(li[1])
if (a * b) % 2 == 0:
    print("Even")
else:
    print("Odd")
x = input()
print (x*x*x,"\n")


### FIXED CODE ###

x = input()
x = int(x)
print (x*x*x)
N = int(input())
A = list(map(int,input().split()))
n = 0
can = True

while can:

    for i in range(N):
        if A[i]%2 != 0:
            can = False
            break

       elif A[i]%2 == 0:         
            A[i] = A[i] // 2
            n += 1

print(n)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
n = 0
F = 0

while 1:
    #すべてが偶数か確認
    for i in range(N):
        if A[i] % 2 == 0:
            continue
        else:
            F = 1
    
    if F == 1 : break 

    for i in range(N):
        A[i] = A[i]/2
    n += 1


print(n)
import sys
sys.setrecursionlimit(1000000)
import numpy as np

H,W=map(int,input().split())
S=[list(input()) for _ in range(H)]

m_horizontal=[[0 for i in range(W)] for j in range(H)]
m_vertical=[[0 for i in range(W)] for j in range(H)]


for y in range(H):
    for x in range(W):
        if S[y][x]=='#':
            m_horizontal[y][x]=0
        elif x==0 or m_horizontal[y][x-1]==0:
            cnt=0
            i=x
            while S[y][i]=='.':
                cnt+=1
                i+=1
                if i==W:
                    break
            m_horizontal[y][x]=cnt
        else:
            m_horizontal[y][x]=m_horizontal[y][x-1]


        if S[y][x]=='#':
            m_vertical[y][x]=0
        elif y==0 or m_vertical[y-1][x]==0:
            cnt=0
            i=y
            while S[i][x]=='.':
                cnt+=1
                i+=1
                if i==H:
                    break
            m_vertical[y][x]=cnt
        else:
            m_vertical[y][x]=m_vertical[y-1][x]

ho=np.array(m_horizontal)
ve=np.array(m_vertical)
hv=ho+ve
print(np.amax(hv)-1)

### FIXED CODE ###

import numpy as np

H, W = map(int, input().split())
S = np.array([list(input()) for _ in range(H)]) == "."

D = np.zeros((H, W), dtype=int)
U = np.zeros((H, W), dtype=int)
R = np.zeros((H, W), dtype=int)
L = np.zeros((H, W), dtype=int)

for i in range(H):
    U[i] = (U[i-1]+1)*S[i]
    D[-i - 1] = (D[-i] + 1) * S[-i - 1]

for i in range(W):
    L[:, i] = (L[:, i - 1] + 1) * S[:, i]
    R[:, -i - 1] = (R[:, -i] + 1) * S[:, -i - 1]

print(np.max(D + U + R + L) - 3)
A, B, C, D = [int(x) for x in input().split(" ")]

c = (B // C) - (A // C) + int(A % C == 0)
d = (B // D) - (A // D) + int(A % D == 0)
lcm_cd = (C * D) // gcd(C, D)
cd = (B // (lcm_cd)) - (A // (lcm_cd)) + int(A % (lcm_cd) == 0)

c_or_d = c + d - cd

print((B - A + 1) - c_or_d)


### FIXED CODE ###

from fractions import gcd

A, B, C, D = [int(x) for x in input().split(" ")]

c = (B // C) - (A // C) + int(A % C == 0)
d = (B // D) - (A // D) + int(A % D == 0)
lcm_cd = (C * D) // gcd(C, D)
cd = (B // (lcm_cd)) - (A // (lcm_cd)) + int(A % (lcm_cd) == 0)

c_or_d = c + d - cd

print((B - A + 1) - c_or_d)
h,w=map(int,input().split())
dp=[[[0] for i in range(w+1)] for j in range(h+1)]

A=[list(map(int,input().split())) for j in range(w)]
B=[list(map(int,input().split())) for j in range(w)]
C=[[abs(A[i][j]-B[i][j]) for j in range(h)] for i in range(w)]    

for i in range(h):
    for j in range(w):
        now=C[i+1][j+1]
        dp[i+1][j+1]=min(abs(dp[i][j+1]-now),abs(dp[i+1][j]-now))

print(dp[h][w])

### FIXED CODE ###

import sys 
def input():return sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**7)
H,W=map(int,input().split())
A=[[int(x) for x in input().split()] for _ in range(H)]
B=[[int(x) for x in input().split()] for _ in range(H)]
C=[[0] * W for _ in range(H)]
for i in range(H):
    for j in range(W):
        C[i][j]=abs(A[i][j]-B[i][j])
center=80 * (H + W)
dp=[[0]*W for _ in range(H)]
dp[0][0]=(1<<(center - C[0][0]))|(1<<(center+C[0][0]))
for i in range(H):
    for j in range(W):
        if i:
            dp[i][j]|=dp[i-1][j]<<C[i][j]
            dp[i][j]|=dp[i-1][j]>>C[i][j]
        if j:
            dp[i][j]|=dp[i][j-1]<<C[i][j]
            dp[i][j]|=dp[i][j-1]>>C[i][j]            
ans=center*2
for i in range(center*2):
    if (dp[H-1][W-1]>>i)&1:
        ans=min(ans,abs(i-center))
print(ans)
n,m = input().split()
a = [i for i in input.split()]
if sum(a)>n:
    print(-1)
else:
    print(m-sum(a))

### FIXED CODE ###

n,m = (int(x) for x in input().split())
a = [int(i) for i in input().split()]
if sum(a)>n:
    print(-1)
else:
    print(n-sum(a))
n, a, b = [int(i) for i in input().split]

if a + b == 0:
  print(0)
else:
  c, r = n // (a + b), n % (a + b)
  nblue = c * a + min(a, r)
  print(nblue)


### FIXED CODE ###

def main():
    n, a, b = [int(i) for i in input().split()]

    if a + b == 0:
        print(0)
    else:
        c, r = n // (a + b), n % (a + b)
        nblue = c * a + min(a, r)
        print(nblue)

main()