akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h> 

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()
#define endl "\n"

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);

  string L;
  cin>>L;
  int N=L.size();
  vector<vector<ll>>dp(N,vector<ll>(2,0));
  dp[0][0]=2;
  dp[0][1]=1;
  for(int i=1;i<N;i++){
    if(L[i]=='1'){
      dp[i][0]=(dp[i-1][0]*2)%MOD;
      dp[i][1]=(dp[i-1][0]+dp[i-1][1]*3)%MOD;
    }
    if(L[i]=='0'){
      dp[i][0]=dp[i-1][0];
      dp[i][1]=(dp[i-1][1]*3)%MOD;
    }
  }
  cout<<(dp[N-1][0]+dp[N-1][1])%MOD<<endl;
  return 0;
}


Measured memory_bytes: 5840
#include<bits/stdc++.h>

using namespace std;
const int MOD = 1000000007,MAX = 510000;
long int pow107 = (int)pow(10, 9) + 7,llimit = LONG_MAX,fac[MAX], finv[MAX], inv[MAX];
int ilimit = INT_MAX;

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long int COM(long int n,long int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

bool comp(pair<int, int> a, pair<int, int> b){
    if(a.first != b.first) return a.first > b.first;
    else return a.second < b.second;
}

long int jou(long int x, long int y){
    long int f = 1;
    for(int i = 0; i < y; ++i){
        f = f * x % pow107;
    }
    return f;
}

bool pn(long int x){
    if(x != 2 && x % 2 == 0)
        return false;
    for(int i = 3; i < x; ++i){
        if(x != i && x % i == 0)
            return false;
    }
    return true;
}

long int factorial(long int n){
    long int f = 1;
    for(long int i = 1; i <= n; ++i){
        f = f * i % pow107;
    }
    return f;
}

long int Func2(long int n,long int m){
    long int s2 = 1,
        r = 1;
    for(long int i = 1; i <= m; ++i){
        s2 = (s2*(n - (i - 1))/i) % (pow107);
    }
    return s2;
}

bool secsort(pair<int, int> a, pair<int, int> b){
    if(a.second == b.second)return a.first > b.first;
    else return a.second > b.second;
}

long int GCD(long int a,long int b){
    if(b == 0)return a;
    return GCD(b,a%b);
}

long int LCM(long int a,long int b){
    return a/GCD(a,b)*b;
}

//long intの最大llimit
//intの最大ilimit
//10^9+7    pow107
//素数pn
//n乗jou
//階乗factorial
//コンビネーションFunc2
//コンビネーションCOMinit(),COM(n,m)

int main(){
    double r,g;
    cin >> r >> g;
    cout << g*2 - r << endl;
}

Measured memory_bytes: 256
package main

import "fmt"

func gcd(A int, B int) int {

	if B == 0 {
		return A
	}
	return gcd(B, A%B)
}

func lcm(A int, B int) int {

	return A * B / gcd(A, B)
}

func main() {

	var A, B int
	fmt.Scanf("%d %d", &A, &B)

	fmt.Println(lcm(A, B))
}


Measured memory_bytes: 1832
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <stack>
#include <bitset>
using namespace std;
typedef long long LL;
LL gi () {
    LL ret=0; char ch=getchar();
    while((ch<'0' || ch>'9') && ch!='-') ch=getchar();
    char c=ch=='-'?getchar():ch;
    while(c>='0' && c<='9') ret=ret*10+c-'0',c=getchar();
    return ch=='-'?-ret:ret;
}
const int N = 200000 + 10;
int n,m,a[N];
int main () {
    n = gi(); m = gi();
    for(int i=1;i<=n;i+=1) a[gi()] += 1;
    int tot = 0, ans = 0;
    sort(a+1,a+n+1);
    for(int i=n;i>=1;i-=1) {
        if(!a[i]) continue;
        if(tot>=m) ans += a[i];
        tot += 1;
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 1024
import java.util.*;
 
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
      
      if(b-a==c-b){
       System.out.print("YES");
      }else{
       System.out.print("NO");
      }
    }
}

Measured memory_bytes: 23124
import java.util.*;

public class Main {
    public static void main(String[] args) {
        int[] arr = new int[100];
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        for (int j = n - 1; j > 0; j--) {
            System.out.print(arr[j] + " ");
        }
        System.out.println(arr[0]);
        sc.close();
    }
}


Measured memory_bytes: 26248
#include <stdio.h>

void swap(int *a, int *b){
  int tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
  return;
}
int main(){
  int	i,j,state;
  int	w,n;
  char	tmp[32];
  int   ans[32];
  int   a,b;

  fgets(tmp, 32, stdin);
  sscanf(tmp, "%d", &w);
  for(i=0;i<w+1;i++)
	ans[i] = i;

  fgets(tmp, 32, stdin);
  sscanf(tmp, "%d", &n);
  for(i=1;i<n+1;i++){
	fgets(tmp, 32, stdin);
	sscanf(tmp, "%d,%d", &a,&b);
	swap(&ans[a], &ans[b]);
  }
  for(i=1;i<w+1;i++)
	printf("%d\n", ans[i]);

  return 0;
}

Measured memory_bytes: 604
#include <bits/stdc++.h>
#include <algorithm>
//#include <string>
using namespace std;

int main(){
  string s;
  cin >> s;
  int now = 0;

  if(s.length() % 2 == 0){
    now = 2;
  }
  else{
    now = 1;
  }

  while(1){
    //cout << "now " << now << endl;
    string a = s.substr(0, (s.length() - now) / 2);
    string b = s.substr((s.length() - now) / 2, (s.length() - now) / 2);
    //cout << "a " << a << endl;
    //cout << "b " << b << endl;
    if(a.compare(b) == 0){
      break;
    }
    now += 2;
  }

  cout << s.length() - now << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<string>
using namespace std;

int main()
{
	string s;
	int a=0;
	cin >> s;
	if (s[0] == '1') ++a;
	if (s[1] == '1') ++a;
	if (s[2] == '1') ++a;
	cout << a;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

ll gcd(ll a, ll b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N;
    cin >> N;
    vector<ll> a(N);
    for(int i = 0; i < N; i++){
        cin >> a[i];
    }

    vector<ll> sum_a(N);
    sum_a[0] = a[0];
    for(int i = 1; i < N; i++){
        sum_a[i] = sum_a[i-1] + a[i];
    }

    ll ans = INF;
    for(int i = 0; i < N-1; i++){
        chmin(ans, abs(sum_a[i] - (sum_a[N-1]-sum_a[i])  ));
    }

    cout << ans << endl;


    return 0;
}



Measured memory_bytes: 3456
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define pb push_back
#define sz(s) ((int) ((s).size()))

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

typedef long long ll;
typedef long double ld;

const int inf = (int) 1.01e9;
const ld eps = 1e-11;
const ld pi = acos(-1.0L);

mt19937 mrand(random_device{} ());
int rnd(int x) {
  return mrand() % x;
}

const int mod = (int) 1e9 + 7;

void add(int & x, int y) {
  if ((x += y) >= mod) {
    x -= mod;
  }
}

int sum(int x, int y) {
  add(x, y);
  return x;
}

int mult(int x, int y) {
  return (ll) x * y % mod;
}

int power(int x, ll p) {
  int res = 1;
  while (p) {
    if (p & 1) {
      res = mult(res, x);
    }
    x = mult(x, x);
    p >>= 1;
  }
  return res;
}

int inv(int x) {
  return power(x, mod - 2);
}

const int maxn = 1e6;
int fact[maxn];

void precalc() {
  fact[0] = 1;
  for (int i = 1; i < maxn; i++) {
    fact[i] = mult(i, fact[i - 1]);
  }
}

int n;
int x, y;
int c[maxn], w[maxn];

bool read() {
  if (scanf("%d%d%d", &n, &x, &y) < 3) {
    return false;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d%d", c + i, w + i);
  }
  return true;
}

void solve() {
  map<int, vector<int> > ws;
  int mn = inf, mn2 = inf;
  int mni = -1, mni2 = -1;
  for (int i = 0; i < n; i++) {
    ws[c[i]].pb(w[i]);
    if (w[i] < mn2) {
      mn2 = w[i];
      mni2 = c[i];
    }
    if (mn2 < mn) {
      swap(mn2, mn);
      swap(mni2, mni);
    }
  }
  vector<int> mult;
  int sum = 0;
  for (auto vi : ws) {
    auto & v = vi.second;
    sort(v.begin(), v.end());
    if (v[0] + mn <= y) {
      int cur = 1;
      sum++;
      for (int i = 1; i < sz(v); i++) {
        if (v[i] + v[0] > x) {
          if (mni != vi.first) {
            if (v[i] + mn > y) {
              break;
            }
          } else {
            if (mn2 + v[i] > y) {
              break;
            }
          }
        }
        cur++;
        sum++;
      }
      mult.pb(cur);
    }
  }
  int res = fact[sum];
  for (auto i : mult) {
    res = ::mult(res, inv(fact[i]));
  }
  printf("%d\n", res);
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen("text.in", "r", stdin));
  assert(freopen("text.out", "w", stdout));
#endif

  while (read()) {
    solve();
#ifdef DEBUG
    eprintf("Time: %.3f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}



Measured memory_bytes: 26624
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def MAP1()  : return map(lambda x:int(x)-1,input().split())
def LIST()  : return list(MAP())
def LIST1() : return list(MAP1())

def solve():
    n = input()
    tmp = 0
    for x in n:
        tmp += int(x)
    ans = "Yes" if tmp % 9 == 0 else "No"
    print(ans)

if __name__ == '__main__':
    solve()

Measured memory_bytes: 10412
using System;
using System.Collections.Generic;
using System.Linq;

public static class Program
{
    public static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var dict = new Dictionary<string, int>();
        for (int i = 0; i < n; i++)
        {
            var w = Console.ReadLine();
            if (!dict.ContainsKey(w))
            {
                dict[w] = 1;
            }
            else
            {
                dict[w]++;
            }
        }
        var max = dict.Values.Select(x => x).Max();
        var list = dict.Where(x => x.Value == max).Select(y => y.Key).ToList();
        list.Sort(StringComparer.Ordinal);
        foreach (var item in list)
        {
            Console.WriteLine(item);
        }
    }
}

Measured memory_bytes: 42844
S = input()
N = len(S)
f = [0]*(N+1)
cnt = 0
for i in range(N):
    if S[i] == '<':
        cnt += 1
        f[i+1] = cnt
    else:
        cnt = 0
        f[i+1] = 0
g = [0]*(N+1)
for i in range(N):
    if S[-i-1] == '>':
        cnt += 1
        g[N-i-1] = cnt
    else:
        cnt = 0
        g[N-i-1] = cnt
ans = 0
for i in range(N+1):
    ans += max(f[i], g[i])
print(ans)

Measured memory_bytes: 51272
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main()
{
    ll A, B, M;
    vector<ll> a;
    vector<ll> b;
    ll min_a = 1000000;
    ll min_b = 1000000;

    cin >> A >> B >> M;
    for (int i = 0; i < A; ++i)
    {
        ll temp;
        cin >> temp;
        a.push_back(temp);
        min_a = min(min_a, temp);
    }
    for (int i = 0; i < B; ++i)
    {
        ll temp;
        cin >> temp;
        b.push_back(temp);
        min_b = min(min_b, temp);
    }
    ll x, y, c;
    ll ans = 300000;

    for (int i = 0; i < M; ++i)
    {
        cin >> x >> y >> c;
        ll temp = a[x - 1] + b[y - 1] - c;
        ans = min(temp, ans);
    }

    cout << min(ans, min_a + min_b) << endl;
}


Measured memory_bytes: 2676
def bisect(h, w)
  [[(h/2)*w, (h-h/2)*w],
   [h*(w/2), h*(w-w/2)]]
end

def trisect(h, w)
  res = []

  hh = h/3
  if hh > 0
    res += bisect(h - hh, w).map { |pair| [hh*w, *pair] }
  end
  if h%3 > 0
    hh += 1
    res += bisect(h - hh, w).map { |pair| [hh*w, *pair] }
  end
  ww = w/3
  if ww > 0
    res += bisect(h, w - ww).map { |pair| [h*ww, *pair] }
  end
  if w%3 > 0
    ww += 1
    res += bisect(h, w - ww).map { |pair| [h*ww, *pair] }
  end

  res
end

h, w = gets.split.map(&:to_i)
choices = trisect(h, w)
p choices.map { |tri| tri.max - tri.min }.min

Measured memory_bytes: 1788
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18+7)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mkt make_tuple
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x > 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1) * x % mod;
}
int mod_pow(int x, int y, int mod_) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % mod_;
		}
		x = x * x % mod_;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	return kai(x)* mod_pow(kai(x - y), mod - 2, mod) % mod * mod_pow(kai(y), mod - 2, mod) % mod;
}
/*--------Library Zone!--------*/


signed main() {
	int n; cin >> n;
	int ans = 0;
	for (int i = 1;; i++) {
		if ((n - i) % i == 0) {
			int res = (n - i) / i;
			if (res > i)ans += res;
		}
		if ((n - i) / i <= i)break;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;

int main(){
    string S;
    cin >> S;
    
    string L = S.substr(0,2);
    string K = S.substr(2,2);
    
    int l = stoi(L);
    int k = stoi(K);
    
    if(l >= 1 && l <= 12){
        if(k >= 1 && k <= 12){
    cout << "AMBIGUOUS" << endl;
        }
        else{
            cout << "MMYY" << endl;
        }
    }
    else if(k >= 1 && k <= 12){
         cout << "YYMM" << endl;
    }
    
    else  cout << "NA" << endl;

}


Measured memory_bytes: 256
import qualified Data.Vector.Unboxed as VU
import qualified Data.ByteString.Char8 as B
import Data.List
import Data.Maybe
import Control.Monad

lowerBound :: VU.Vector Int -> (Int, Int) -> Int -> Int
lowerBound vec (from, to) target
    | from == to = from
    | mValue >= target = lowerBound vec (from, mid) target
    | mValue < target = lowerBound vec (mid + 1, to) target
        where
            mid = (from + to) `quot` 2
            mValue = vec VU.! mid

solve :: VU.Vector Int -> Int -> Int -> Int
solve ys n x
    | lb < q = ys VU.! q
    | otherwise = ys VU.! (q-1)
    where 
        q = n `quot` 2
        lb = lowerBound ys (0, n) x
        
main = do
    n <- readLn :: IO Int
    xs <- map (fst . fromJust . B.readInt) . B.words <$> B.getLine :: IO [Int]
    let ys = VU.fromList $ sort xs
    forM_ xs $ \x -> print $ solve ys n x

Measured memory_bytes: 51324
#include <bits/stdc++.h>
using namespace std;

int main() {
    int N;
    cin >> N;

    
    vector<string> lis(N); 

    int nA = 0, nB = 0, nAB = 0, both = 0;

    for(int i = 0; i < N; ++i){
        string tmp;
        cin >> tmp;

        for(int j = 0; j < tmp.length() - 1; ++j){
            if(tmp[j] == 'A' && tmp[j + 1] == 'B'){
                nAB++;
            }
        }
        if(tmp[0] == 'B'){
            nB++;
        }
        if(tmp[tmp.length() - 1] == 'A'){
            nA++;
        }
        if(tmp[0] == 'B' && tmp[tmp.length() - 1] == 'A'){
            both++;
        }
    }
    // cout << nAB << " " << nA << " " << nB << " " << both << endl;
    int ans = nAB + min(nA, nB);

    if(nA == both && nB == both){
        ans--;
        if(both == 0){
            ans++;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 384
MOD=1000000007
n,m=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
xs=ys=0
for i in range(1,n+1):
  xs+=((i-1)*x[i-1]-(n-i)*x[i-1])
  xs%=MOD
for i in range(1,m+1):
  ys+=((i-1)*y[i-1]-(m-i)*y[i-1])
  ys%=MOD
ans=xs*ys
print(ans%MOD)

Measured memory_bytes: 18556
list1=[1 for _ in range(55555)]
list1[0]=0
list1[1]=0
for i in range(55555):
    if list1[i]==0:
        pass
    else:
        for j in range(2,55555):
            if i*j>55554:
                break
            else:
                list1[i*j]=0
list2=[]
count=0
for k in range(55555):
    if count==55:
        break
    if list1[k]==0:
        pass
    else:
        if k%10==1:
            list2.append(k)
            count+=1
#print(list2)
N=int(input())
ans=str(list2[0])
for l in range(N-1):
    ans=ans+" "+str(list2[l+1])
print(ans)

Measured memory_bytes: 3608
#include <stdio.h>

#define N   101

void swap(int *x, int *y) {
	int temp = *x;
	*x = *y;
	*y = temp;
}

int Selection_Sort(int a[], int num) {
	int i, j, mini, counter = 0;
	for (i = 1; i <= num; i++) {
		mini = i;
		for (j = i; j <= num; j++) {
			if (a[j] < a[mini]) {
				mini = j;
			}
		}
		if (i != mini) {
		swap(&a[i], &a[mini]);
		counter++;
		}
	}
	return counter;
}

int main(void) {
	int i, n, count;
	int A[N];
	scanf("%d", &n);

	for (i = 1; i <= n; i++) {
		scanf("%d", &A[i]);
	}

	count = Selection_Sort(A, n);

	for (i = 1; i < n; i++) {
		printf("%d ", A[i]);
	}
	printf("%d\n%d\n", A[n], count);

	return 0;
}

Measured memory_bytes: 600
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 1000000007;

template<class _T> static void getint(_T& a) {
	std::cin >> a;
}
template<class _T> static void getint(_T& a, _T& b) {
	std::cin >> a >> b;
}
template<class _T> static void getint(_T& a, _T& b, _T& c) {
	std::cin >> a >> b >> c;
}

static void ABC080D();

int main()
{
	ABC080D();
	fflush(stdout);
	return 0;
}

static void ABC080D()
{
	int N, C;
	getint(N, C);

	int st, et, ch;
	std::vector<std::vector<int>> counter(100001, std::vector<int>(C, 0));
	for (int i = 0; i < N; i++) {
		getint(st, et, ch); st--; et--; ch--;	//	0-indexed
		counter[st][ch]++;
		counter[et][ch]--;
	}

	int needDeck = 0, recCount = 0, endShow = 0;
	for (int i = 0; i < 100001; i++) {
		endShow = 0;
		for (int ch = 0; ch < C; ch++) {
			recCount += counter[i][ch];
			if (counter[i][ch] < 0) {
				endShow++;
			}
		}
		needDeck = std::max(needDeck, recCount + endShow);
	}
	printf("%d\n", needDeck);
}


Measured memory_bytes: 18028
#include <bits/stdc++.h>
using namespace std;

int main()
{


        int S;
        cin >> S;

        int cnt = 0;
        int s = S;
        while (1) {

                cnt++;
                if (s == 4 || s == 2 || s == 1) {
                        cout << cnt + 3 << endl;
                        break;
                }

                if (s % 2 == 0) {
                        s /= 2;
                }
                else {
                        s = 3 * s + 1;
                }

        }




}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
char num[555555];
int j,sum=0,a[555555];
int main()
{
	scanf("%s",num);
	int n=strlen(num);
	for(int i=1;i<=n;i++)
	{
		a[i]=(num[n-i]-'0')*9;
	}
	for(int i=1;i<=n;i++)
	{
		a[i+1]+=a[i]/10;a[i]%=10;
	}
	if(a[n+1])
	{
		n++;
	}
	for(int i=1;i<=n;i++)
	{
		sum+=a[i];
	}
	for(int k=1;k<=n*10;k++)
	{
		a[1]+=9;
		sum+=9;
		j=1;
		while(j<=n)
		{
			if(a[j]<10)
			{
				break;
			}
			sum-=10;
			a[j]-=10;
			sum++;
			a[j+1]++;
			j++;
			if(j==n&&a[j+1])
			{
				n++;
			}
		}
		if(sum<=9*k)
		{
			printf("%d\n",k);
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 2560
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author cherrypi59
 */

#pragma GCC optimize ("O2")
#pragma GCC optimize ("tree-vectorize")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define FFOR(i, a, b) FOR(i, a, b+1)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FOR(i, 1, n+1)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define LEN(x) (int)(x).size()
#define DUMP(x) cerr<<__LINE__<<' '<<#x<<"="<<(x)<<endl;
#define pb push_back
#define eb emplace_back
#define mp make_pair

using namespace std;
using lint = long long;
using pii =  pair<int, int>;
using pll =  pair<lint, lint>;
template <typename T> using vc = vector<T>;
template <typename T> using vvc = vector<vector<T>>;
template <typename T> inline bool chmax(T &a, T b){if(a<b){a = b; return true;} return false;}
template <typename T> inline bool chmin(T &a, T b){if(a>b){a = b; return true;} return false;}

constexpr lint ten(int n) {return n==0 ? 1 : ten(n-1)*10;}

class CAverageLength {
public:
    int f(pii& p1, pii& p2){
        return (p1.first-p2.first) * (p1.first-p2.first) + (p1.second-p2.second) * (p1.second-p2.second);
    }
    void solve(std::istream& in, std::ostream& out){
        ios_base::sync_with_stdio(false);
        in.tie(nullptr), out.tie(nullptr);
        int N;
        in>>N;
        vc<pii> A(N);
        for(auto& a : A) in>>a.first>>a.second;
        vc<int> P(N);
        REP(i, N) P[i] = i;
        double ans = 0;
        do{
            REP(i, N-1){
                pii cur = A[P[i]],  nxt = A[P[i+1]];
                ans += sqrt(f(cur, nxt));
            }
        }while(next_permutation(ALL(P)));
        RREP(i, N) ans /= i;
        out<<fixed<<setprecision(12)<<ans<<'\n';
    }
};


int main() {
	CAverageLength solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3792
program main
  implicit none
  integer :: A,B,C,X,Y
  integer :: out,tmp,i
  read(*,*) A,B,C,X,Y
  i = 0
  out =  max(0,X-i)*A + max(0,Y-i)*B
  do i = 1,max(X,Y) 
     tmp = i * 2*C + max(0,X-i)*A + max(0,Y-i)*B
     if (tmp < out) then
        out = tmp
     end if
  end do
  write(*,'(i0)') out
  stop
end program main


Measured memory_bytes: 256
#include <stdlib.h>
#include <bits/stdc++.h>
using namespace std;

int main() {
	char a;
    cin >> a;
    if(a=='A')
        cout<<"T";
    if(a=='T')
        cout<<"A";
    if(a=='C'){
        cout<<"G";
    }
    if(a=='G'){
        cout<<"C";
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;

static const int INF = 1e9 + 7;

template<typename T>
using Vec = vector<T>;

template<typename T, typename T2>
using P = pair<T, T2>;

template<typename... Args>
using Tup = tuple<Args...>;

template<typename T>
using qp = priority_queue<T, Vec<T>, greater<T> >;

template<typename T>
using pq = priority_queue<T>;

using llong = long long;
using ullong = unsigned long long;
using uint = unsigned int;

template<typename T>
T gcd(T x, T y)
{
	return y ? gcd(y, x % y) : x;
}

void hawawa()
{
	int a, b, k;
	cin >> a >> b >> k;
	set<int> s;
	for (int i = 0; i < k; i++) {
		if(a + i <= b)
			s.insert(a + i);
		if (b - i >= a)
			s.insert(b - i);
	}
	for (auto&& i : s) {
		cout << i << "\n";
	}
}


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	hawawa();
}


Measured memory_bytes: 256
#include<stdio.h>
#include<vector>
#include<algorithm>

int main(){
    int i;
    int input;
    std::vector<int> height;
    for (i = 0; i < 10; i++){
        scanf("%d", &input);
        height.push_back(input);
    }

    std::sort(height.begin(), height.end());

    printf("%d\n", height[9]);
    printf("%d\n", height[8]);
    printf("%d\n", height[7]);

    return 0;
}

Measured memory_bytes: 2716
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()

a = LIST()

first = a[:]

dd = defaultdict(int)

for i in range(n):
    first[i] = first[i]+(i+1)
    dd[first[i]]+=1

ans = 0

for i in range(n):
    ans+=dd[(i+1)-a[i]]
print(ans)

Measured memory_bytes: 133008
// Approach: Compute the Stirling number of the second kind S(n, k)
// S(n, k) = kS(n-1, k) + S(n-1, k-1) [https://dlmf.nist.gov/26.8.E22]

#include <iostream>
#include <vector>
using namespace std;
using ull = unsigned long long;
constexpr ull M = 1000000007ull;

int main() {
  int N, K;
  cin >> N >> K;
  if (K > N) {
    cout << 0 << endl;
    return 0;
  }
  vector<vector<ull>> S(2, vector<ull>(N + 1));
  for (int i = 0; i <= N; ++i)
    S[1][i] = 1;
  for (int k = 2; k <= K; ++k) {
    S[k % 2].assign(N + 1, 0);
    for (int i = k; i <= N; ++i)
      S[k % 2][i] = (k * S[k % 2][i - 1] + S[!(k % 2)][i - 1]) % M;
  }
  cout << S[K % 2][N] << endl;
}



Measured memory_bytes: 3184
// C.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>

using namespace std;

typedef long long LL;

LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; }
LL lcm(LL a, LL b) { return (a / gcd(a, b)) * b; }

LL count(LL x, LL y) {
	return x / y;
}

LL count(LL x, LL y, LL z) {
	return count(y, z) - count(x - 1, z);
}

int main(int argc, char *argv[]) {
	LL a, b, c, d;
	cin >> a >> b >> c >> d;
	LL ans = b - a + 1 - count(a, b, c) - count(a, b, d) + count(a, b, lcm(c, d));
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

#ifdef __LOCAL
    #include <filesystem>
    namespace fs = std::filesystem;
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
static mt19937 _g(time(nullptr));
 
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

ll K,N;
vector<ll> A;
void input(){
    fast_io();
    #ifdef __LOCAL
        fs::path p = __FILE__;
        fs::path input,output;
        input = output = p.parent_path();
        input += string("/input/") + string(p.stem()) + string(".txt");
        output += string("/output/") + string(p.stem()) + string(".txt");
        freopen(input.c_str(), "r", stdin);
        freopen(output.c_str(), "w", stdout);
    #endif
    cin >> K >> N;
    A = fetch_vec<ll>(N);
}

int solve(){
    vector<ll> inter;
    for (int i = 0; i < N-1; i++)
    {
        inter.push_back(A[i+1]-A[i]);
    }
    inter.push_back(K-A[N-1]+A[0]);
    ll ma = *max_element(inter.begin(),inter.end());
    ll ans = K-ma;
    cout << ans << endl;
    
    return 0;
}   

int main()
{
    input();
    solve();
    return 0;
}


Measured memory_bytes: 3956
#include<stdio.h>
#include<string.h>
int main(void)
{
    unsigned char s[200002];
    long int i,j,a,sum = 0;
    scanf("%s",s);
    a = strlen(s);
    for(i = 0 ; i < a ; i++)
    {
    
        
        
        if(s[i] == '1')
        {
            
            sum += 1;
            
            sum = sum % 9 ;
            
        }
        if(s[i] == '2')
        {
            
            sum += 2;
            
            sum = sum % 9 ;
            
        }
        if(s[i] == '3')
        {
            
            sum += 3;
            
            sum = sum % 9 ;
            
        }
        if(s[i] == '4')
        {
            
            sum += 4;
            
            sum = sum % 9 ;
            
        }
        if(s[i] == '5')
        {
            
            sum += 5;
            
            sum = sum % 9 ;
            
        }
        if(s[i] == '6')
        {
            
            sum += 6;
            
            sum = sum % 9 ;
            
        }
        if(s[i] == '7')
        {
            
            sum += 7;
            
            sum = sum % 9 ;
            
        }
        if(s[i] == '8')
        {
            
            sum += 8;
            
            sum = sum % 9 ;
            
        }
        if(s[i] == '9')
        {
            
            sum += 9;
            
            sum = sum % 9 ;
            
        }
        if(s[i] == '0')
        {
            
            sum += 0;
            
            sum = sum % 9 ;
            
        }
    }
    sum = sum % 9;
    if(sum == 0)
    {
        printf("Yes\n");
    }
    else
    {
        printf("No\n");
    }
    
    return 0;
}

Measured memory_bytes: 1820
#include <bits/stdc++.h>
#define GET_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#define pr(...) cerr<< GET_MACRO(__VA_ARGS__,pr8,pr7,pr6,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__) <<endl
#define pr1(a) (#a)<<"="<<(a)<<" "
#define pr2(a,b) pr1(a)<<pr1(b)
#define pr3(a,b,c) pr1(a)<<pr2(b,c)
#define pr4(a,b,c,d) pr1(a)<<pr3(b,c,d)
#define pr5(a,b,c,d,e) pr1(a)<<pr4(b,c,d,e)
#define pr6(a,b,c,d,e,f) pr1(a)<<pr5(b,c,d,e,f)
#define pr7(a,b,c,d,e,f,g) pr1(a)<<pr6(b,c,d,e,f,g)
#define pr8(a,b,c,d,e,f,g,h) pr1(a)<<pr7(b,c,d,e,f,g,h)
#define prArr(a) {cerr<<(#a)<<"={";int i=0;for(auto t:(a))cerr<<(i++?", ":"")<<t;cerr<<"}"<<endl;}
using namespace std;
using Int = long long;
using _int = int;
using ll = long long;
using Double = long double;
const Int INF = (1LL<<60)+1e9; // ~ 1.15 * 1e18
const Int mod = (1e9)+7;
const Double EPS = 1e-8;
const Double PI = 6.0 * asin((Double)0.5);
using P = pair<Int,Int>;
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
template<class T1, class T2> ostream& operator<<(ostream& o,pair<T1,T2> p){return o<<"("<<p.first<<","<<p.second<<")";}
template<class T1, class T2, class T3> ostream& operator<<(ostream& o,tuple<T1,T2,T3> t){
  return o<<"("<<get<0>(t)<<","<<get<1>(t)<<","<<get<2>(t)<<")";}
template<class T1, class T2> istream& operator>>(istream& i,pair<T1,T2> &p){return i>>p.first>>p.second;}
template<class T> ostream& operator<<(ostream& o,vector<T> a){Int i=0;for(T t:a)o<<(i++?" ":"")<<t;return o;}
template<class T> istream& operator>>(istream& i,vector<T> &a){for(T &t:a)i>>t;return i;}

bool check(string s){
  int n = s.size();
  if(s[0] == '0' || s[n-1] == '1') return 0;
  s = '!' + s;
  for(int i=1;i<n;i++){
    int a = i, b = n - i;
    if(s[a] != s[b]) return 0;
  }
  return 1;
}


signed main(){
  srand((unsigned)time(NULL));
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  string s;
  cin>>s;

  if(check(s) == 0){
    cout<<-1<<endl;
    return 0;
  }

  int n = s.size();
  int last = 0;
  vector<vector<int> > G(n);

  auto add_edge = [&](int a,int b){
    G[a].push_back(b);
    G[b].push_back(a);
  };

  add_edge(0, 1);
  
  for(int i=1;i<n-1;i++){
    if(s[i] == '1') add_edge(last,i+1), last = i+1;
    else add_edge(last,i+1);
  }


  for(int i=0;i<n;i++)
    for(int to:G[i]){
      if(i > to) continue;
      cout<<i+1<< " "<<to+1<<endl;
    }
  
  return 0;
}


Measured memory_bytes: 8704
/*
    Author: Nguyen Tan Bao
    Status:
    Idea:
*/

#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x

using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<II, int> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;

const ll MODBASE = 1000000007LL;
const int MAXN = 110;
const int MAXM = 1000;
const int MAXK = 16;
const int MAXQ = 200010;

int n, a[MAXN];
ll dp[MAXN];

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cin >> n;
    FOR(i,1,n) cin >> a[i];
    dp[1] = 1000;
    FOR(i,1,n)
        FOR(j,1,i-1) {
            dp[i] = max(dp[i], dp[j]);
            ll stock = dp[j] / a[j];
            ll money = dp[j] % a[j];
            dp[i] = max(dp[i], stock * a[i] + money);
        }
    ll res = 0;
    FOR(i,1,n) res = max(res, dp[i]);
    cout << res;
    return 0;
}


Measured memory_bytes: 3644
import math
import itertools

n = int(input())
t = [list(map(int, input().split())) for _ in range(n)]
d = 0
for i in range(n - 1):
    for j in range(i, n):
        d += (((t[i][0] - t[j][0]) ** 2 + (t[i][1] - t[j][1]) ** 2)
              ** 0.5) * ((n - 1) * math.factorial(n)/len(list(itertools.combinations(range(n), 2))))

print(d/math.factorial(n))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define ll          long long int
#define ld          long double
#define pb          push_back
#define mp          make_pair
#define ff          first
#define se          second
#define endl        '\n'
#define fd(n)       fixed<<setprecision(n)
#define MAX         1000000000000000000
#define MAXN        200000005
#define mod         1000000007
using namespace std;
 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,i,count=0,ans;
    cin>>n;
    string s;
    cin>>s;
    if(n==1){
        cout<<1;
    }
    else{
        for(i=0;i<n-1;i++){
            if(s[i]==s[i+1]){
                count++;
            }
        }
        ans=n-count;
        cout<<ans;
    }
}

Measured memory_bytes: 512
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
ALL = []
for i in range(N):
    ALL.append( int(V[i]-C[i]) )
ALL.sort()
ALL.reverse()
AllMax = 0
for i in range(N):
    if i == 0:
        if ALL[0] < 0:
            break
        else:
            AllMax = AllMax+ALL[i]
    elif ALL[i] < 0:
        break
    elif ALL[i] >= 0:
        AllMax = AllMax+ALL[i]
        
print(AllMax)

Measured memory_bytes: 3064
#include <bits/stdc++.h>

using namespace std;

int main(void){
    long long n;

    cin >> n;

    if(n%2 == 1){
        cout << 0 << endl;
        return 0;
    }

    long long dec = n / 10ll;

    long long fiv = 50ll;
    while(n / fiv > 0ll){
        dec += n/fiv;
        fiv *= 5ll;
    }

    cout << dec << endl;

    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
ll MOD = 1000000007;

int main(){
  int N;
  cin >> N;
  char s[2][N];
  for(int i=0;i<N;i++) cin >> s[0][i];
  for(int i=0;i<N;i++) cin >> s[1][i];

  int i = 0;
  ll ans = 1;
  if(s[0][0] == s[1][0]){
    ans *= 3;
    i = 1;
  } else {
    ans *= 6;
    i = 2;
  }

  while(i < N){
    if(s[0][i-1] != s[1][i-1]){
      if(s[0][i] == s[1][i]){
        ans *= 1;
        ans %= MOD;
        i += 1;
      } else {
        ans *= 3;
        ans %= MOD;
        i += 2;
      }
    } else {
      if(s[0][i] == s[1][i]){
        ans *= 2;
        ans %= MOD;
        i += 1;
      } else {
        ans *= 2;
        ans %= MOD;
        i += 2;
      }
    }
  }

  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
from itertools import combinations_with_replacement as comb_rplc
n,m,q = map(int, input().split())
arr = []

for i in range(q):
  arr.append(list(map(int, input().split())))
  
score_max = 0
for seq in comb_rplc(range(1, (m+1)), n):
  score = 0
  
  for a,b,c,d in arr:
    if seq[b-1]-seq[a-1] == c:
      score += d
      
  if score > score_max:
    score_max = score
    
print(score_max)

Measured memory_bytes: 9156
#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, m, c, ans =0;
	cin >> n >> m >> c;
	vector<int> b(m);
	rep(i,m) cin >> b[i];
	rep(i,n){
		int sum = 0;
		vector<int> a(m);
		rep(j,m){
			cin >> a[j];
			sum += a[j]*b[j];
		}
		sum+=c;
		if(sum > 0) ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string.h>
#include <iostream>

int main(void) {
  int x[5];

  scanf("%d %d %d %d %d", &x[0], &x[1], &x[2], &x[3], &x[4]);

  for(int i = 0; i < 5; i++){
    if(x[i] == 0){
      printf("%d", i+1);
      return 0;
    } 
  }

  return 0;
}

Measured memory_bytes: 3824
#include <iostream>
using namespace std;
int judge(string card1,string card2);
int main(){
	int n;
	int t_win=0,h_win=0;
	cin>>n;
	for(int i=0;i<n;i++){
		string t_card,h_card;
		cin>>t_card>>h_card;
		switch(judge(t_card,h_card)){
			case  1:t_win+=3;break;
			case -1:h_win+=3;break;
			case  0:t_win++;h_win++;break;
		}
	}
	cout<<t_win<<" "<<h_win<<endl;
	return 0;
}
int judge(string card1,string card2){
	int result=0;
	int index=0;
	while(true){
		if(card1.length()==index||card2.length()==index){
			result=(card1.length()==index?(card2.length()==index?0:-1):1);
			break;
		}else if(card1.at(index)!=card2.at(index)){
			result=card1.at(index)>card2.at(index)?1:-1;
			break;
		}
		index++;
	}
	return result;
}

Measured memory_bytes: 1220
A,B=list(map(int,input().split()))
if B==0:
   print(A)
   exit()
N=list(map(int,input().split()))
N=set(N)
S=0
l=float("Inf")
for i in reversed(range(A,A+101)):
   if i not in N:
      S=i
      l=abs(A-i)
for i in reversed(range(A-100,A+1)):
   if i not in N and l >= abs(A-i):
      S=i
      break
print(S)

Measured memory_bytes: 9220
#include <bits/stdc++.h>

int main(){
    int N;
    std::cin >> N;
    std::vector< std::string > S(N);
    for(int i=0; i<N; i++){
        std::cin >> S[i];
    }
    
    std::sort(S.begin(), S.end());
    int cnt = 1;
    for(int i=1; i<N; i++){
        if(S[i] != S[i-1]){
            cnt++;
        }
    }
    
    std::cout << cnt << std::endl;
    
    return 0;
}



Measured memory_bytes: 9544
//PLUS ULTRA

#include<bits/stdc++.h>
using namespace std;
     
     
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define pb push_back 
#define mp make_pair
#define forn(i,st,n) for(int i = st; i < n ; i++)
#define nfor(i,st,n) for(int i = st; i >= n ; i--)
#define ss second
#define ff first

typedef long long ll;
typedef pair <int , int> pii;

const int N = 1e5 + 10 , mod =  1000000007;

void solve(){
	int n; cin >> n;

	if(n%10 == 7 || (n/10)%10 == 7 || (n/100)%10 == 7)
		cout << "Yes" << endl;
	else cout << "No" << endl;


    



}

int main(){
    SPEED;

  	solve();

    return 0;
}
      
       


Measured memory_bytes: 3652
#include <bits/stdc++.h>

using namespace std;

#define MAX 100

char data[MAX][MAX/2][MAX*10];
int plen, cnum, width, cspace, page;
int x, y;
string ss;

void init(){
  page = 0;
  for(int i = 0 ; i < MAX ; i++){
    for(int j = 0 ; j < MAX/2 ; j++){
      for(int k = 0 ; k < MAX*10 ; k++){
        data[i][j][k] = '.';
      }
    }
  }
}

bool check(){
  bool ok = true;
  if(ss.empty()) return ok;

  for(int i = 0 ; i < plen ; i++){
    for(int j = 0 ; j < cnum*width+cspace*(cnum-1) ; j++){
      if(data[i][j][page] != '.') return ok;
    }
  }
  return !ok;
}

void change(){
  y++;
  if(x == cnum){
    x = y = 0;
    page++;
  }else if(y == plen){
    y = 0;
    x++;
    if(x == cnum){
      x = y = 0;
      page++;
    }
  }
}

void insert(string &str){
  int size = str.size(), start;
  int end, p = 0;
  bool flg = true;

  while(flg){
    start = x*(width+cspace);
    if(size - p <= width){
      end = start + size - p;
      flg = false;
    }else{
      flg = true;
      end = start + width;
    }
    for(int i = start ; i < end ; i++, p++){
      if(p == size){ 
        flg = false;
        break;
      }
      data[y][i][page] = str[p];
    }
    change(); 
  }
}

void print(){
  if(!check()) page--;
  for(int k = 0 ; k <= page ; k++){
    for(int i = 0 ; i < plen ; i++){
      for(int j = 0 ; j < cnum*width+cspace*(cnum-1) ; j++){
        cout << data[i][j][k];
      }
      cout << endl;
    }
    cout << '#' << endl;
  }
  cout << '?' << endl;
}

int main(){
  string str;
  while(cin >> plen && plen){
    init();
    cin >> cnum >> width >> cspace;

    cin.ignore();
    x = y = 0;
    while(getline(cin,str), str != "?"){
      ss = str;
      if(str.empty()){
        change();
      }else{
        insert(str);
      }
    }
    print();
  }

  return 0;
}

Measured memory_bytes: 6096
A, B, K =map(int,input().split())
listA = []
listB = []

for i in range(1, A+1) :
    if A % i == 0 :
        listA.append(i)
    if B % i == 0 :
        listB.append(i)

A_B = set(listA) & set(listB)
listA_B = list(A_B)
listA_B.sort(reverse = True)

print(listA_B[K-1])


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
const double PI = 3.14159265358979323846;

int main() {
  int x;
  cin >> x;
  if(x < 1200) cout << "ABC" << endl;
  else cout << "ARC" << endl;
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPrime
//modpow modinv
//getDigit
int main() {
  cout << fixed << setprecision(10);
  int a,b;
  cin >> a >> b;
  if(b%a==0){
    cout << a+b << endl;
  }else{
    cout << b-a << endl;
  }
}


Measured memory_bytes: 256
N, A, B = map(int, input().split())
X = list(map(int, input().split()))
X.sort(reverse=True)
M = sum(X[i] for i in range(A)) / A
print(M)
cntl, cntr = 0, 0
if X[A-1] == X[N-1]:
  cntr = N - A
else:
  cntr = A-1
  while X[A-1] == X[cntr]:
    cntr += 1
  cntr -= A
if X[0] == X[A-1]:
  cntl = A
else:
  cntl = A-1
  while X[A-1] == X[cntl]:
    cntl -= 1
  cntl = A - 1 - cntl
F = 0
c = cntl + cntr
if cntl == A:
  t = 1
  for m in range(A):
    t *= c - m
    t //= m + 1
  for m in range(A, min(B, c)+1):
    F += t
    t *= c - m
    t //= m + 1
  print(F)
else:
  # calc comb(cntl + cntr, cntl)
  t = 1
  for m in range(cntl):
    t *= c - m
    t //= m + 1
  F = t
  print(F)

Measured memory_bytes: 3064
#include<stdio.h>

main()
{
	int r,c;
	scanf("%d %d",&r,&c);
	
	int calc[r+1][c+1];
	calc[r][c]=0;
	
	int i,j;
	
	for(i=0;i<r;i++){
		calc[i][c]=0;
		for(j=0;j<c;j++){
			if(i==0){
				calc[r][j]=0;
			}
			scanf(" %d",&calc[i][j]);
		}
	}
	
	for(i=0;i<=r;i++){
		for(j=0;j<=c;j++){
			if(j!=0){
				printf(" ");
			}
			
			printf("%d",calc[i][j]);
			
			if(j==c){
				printf("\n");
			}
			if(j>=0 && j<=c-1){
				calc[i][c] += calc[i][j];
				if(i!=r){
					calc[r][j] += calc[i][j];
				}
			}
		}
		
	}
	return 0;
}
			

Measured memory_bytes: 640
#include <stdio.h>
#include <stdlib.h>

void ReadInput(int *inputA, int *inputB, int *inputC, int *inputK)
{
    scanf("%d %d %d %d", inputA, inputB, inputC, inputK);
}

void CountA(int * inputA, int * inputK , int * outputVal)
{
    while(1)
    {
        if(*inputA == 0)
        {
            break;
        }
        else if (*inputK == 0)
        {
            break;
        }
        *inputA = *inputA - 1;
        *inputK = *inputK - 1;
        *outputVal = *outputVal + 1;
    }
}

void CountB(int *inputB, int * inputK, int *outputVal)
{
    while(1)
    {
        if(*inputB == 0)
        {
            break;
        }
        else if (*inputK == 0)
        {
            break;
        }
        
        *inputB = *inputB - 1;
        *inputK = *inputK - 1;
        *outputVal = *outputVal + 0;
    }
}

void CountC(int *inputC, int * inputK, int *outputVal)
{
    while(1)
    {
        if(*inputC == 0)
        {
            break;
        }
        else if (*inputK == 0)
        {
            break;
        }
        *inputC = *inputC - 1;
        *inputK = *inputK - 1;
        *outputVal = *outputVal + (-1);
    }
}
void FreeMemory(int *inputA, int *inputB,int *inputC, int * inputK)
{
    free(inputA);
    free(inputB);
    free(inputC);
    free(inputK);
}

int main(int argc, const char * argv[])
{
    int * inputA = malloc(10*sizeof(int));
    int *inputB = malloc(10*sizeof(int));
    int *inputC = malloc(10*sizeof(int));
    int *inputK = malloc(10*sizeof(int));
    int outputVal = 0;
    int * outputValP = &outputVal;
    
    ReadInput(inputA, inputB, inputC, inputK);
    CountA(inputA,inputK, outputValP);
    CountB(inputB,inputK, outputValP);
    CountC(inputC,inputK, outputValP);
    FreeMemory(inputA, inputB, inputC, inputK);
    
    printf("%d \n",outputVal);
    
    return 0;
}


Measured memory_bytes: 1716
#include <algorithm>
#include <bitset>
#include <cmath>
#include <ctime>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(a) begin(a),end(a)
typedef long long ll;
typedef pair<int,int> P;
const int inf=1e+9;
const ll mod=1000000007;
const double PI=3.14159265358979323846;
int dx[] = {1,-1,0,0};
int dy[] = {0,0,1,-1};
ll gcd(ll a, ll b){
  if (b==0) return a;
  else return gcd(b,a%b);
}
int cans(bool f){
  if(f) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


int fac(int num) {
  if(num==1) return 1;
  else return num*fac(num-1);
}





int main() {
  int N;cin >> N;
  int dis = N/15;
  int ans = N*800-dis*200;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
//In the Name of ̲A̲l̲l̲a̲h̲

#define pb push_back
#define F first
#define S second
#define sz size()
#define ll long long

#include <bits/stdc++.h>

using namespace std;

ll n, dp[3001][3001], a[3001], dp2[3001][3001];

int main()
{
	ios_base::sync_with_stdio(0);
	cin >> n;
	for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        dp[i][i] = dp2[i][i] = a[i];
    }
    for (int i = 1; i < n; i++)
    {
        dp[i-1][i] = max(a[i]-a[i-1] , a[i-1]-a[i]);
        dp2[i-1][i] = min(a[i]-a[i-1] , a[i-1]-a[i]);
    }
    for (int j = 2; j < n; j++)
    {
        for (int i = 0; i+j < n; i++)
        {
            dp2[i][i+j] = min(dp[i+1][i+j]-a[i],dp[i][i+j-1]-a[i+j]);
            dp[i][i+j] = max(dp2[i+1][i+j]+a[i],dp2[i][i+j-1]+a[i+j]);
        }
    }
    cout << dp[0][n-1];
}

/*𝐻𝒶𝒹𝒾*/


Measured memory_bytes: 139904