akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

class Program
{
    static void Main()
    {
        int[] HW = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        int H = HW[0];
        int W = HW[1];

        char[] A = new char[H * W];

        for(int i = 0; i < H; i++)
        {
            var line = Console.ReadLine().ToArray();
            line.CopyTo(A, i * W);
        }

       
        var Blacks = A.Select((c, i) => new { c, i }).Where(itm => itm.c == '#').Select(itm => itm.i).ToArray();

        int[] MAP = new int[H * W];

        for (int i = 0; i < MAP.Length; i++) MAP[i] = -1;

        Queue<int> q = new Queue<int>();

        foreach (var black in Blacks)
        {
            MAP[black] = 0;                
            q.Enqueue(black);
        }

        while(q.Any())
        {
            var pt = q.Dequeue();

            var x = pt % W;
            var y = pt / W;

            if (x + 1 < W && MAP[W * y + (x + 1)] == -1)
            {
                MAP[W * y + (x + 1)] = MAP[pt] + 1;
                q.Enqueue(W * y + (x + 1));
            }

            if (x - 1 >= 0 && MAP[W * y + (x - 1)] == -1)
            {
                MAP[W * y + (x - 1)] = MAP[pt] + 1;
                q.Enqueue(W * y + (x - 1));
            }

            if (y + 1 < H && MAP[W * (y + 1) + x] == -1)
            {
                MAP[W * (y + 1) + x] = MAP[pt] + 1;
                q.Enqueue(W * (y + 1) + x);
            }

            if (y - 1 >= 0 && MAP[W * (y - 1) + x] == -1)
            {
                MAP[W * (y - 1) + x] = MAP[pt] + 1;
                q.Enqueue(W * (y - 1) + x);
            }
        }

        Console.WriteLine(MAP.Max());

    }
}



static class MathUtil
{
    public static IEnumerable<IEnumerable<int>> GetPermutation(int n)
    {
        if (n == 0)
        {
            yield return Single(0);
            yield break;
        }

        for (int i = 0; i <= n; i++)
        {
            foreach (var x in GetPermutation(n - 1))
            {
                yield return Single(i).Concat(x.Select(itm => itm < i ? itm : itm + 1));
            }
        }
    }

    private static IEnumerable<int> Single(int x)
    {
        yield return x;
    }

    public static IEnumerable<int> EnumeratePrimeNumbers()
    {
        List<int> primes = new List<int>() { 2 };
        yield return 2;

        for (int i = 3; i < int.MaxValue; i++)
        {
            bool isPrime = true;
            int Sqrt = (int)Math.Sqrt(i) + 1;

            foreach (var prime in primes)
            {
                if (prime > Sqrt)
                {
                    break;
                }
                if (i % prime == 0)
                {
                    isPrime = false;
                    break;
                }
            }

            if (isPrime)
            {
                primes.Add(i);
                yield return i;
            }
        }
    }
}



Measured memory_bytes: 33312
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int my_min(int a,int b)
{
	return a<b ?a:b;
}
int main()
{
	int N;
	scanf("%d",&N);
	int sum=0;
	int p=N;
	while(p>0)
	{
		sum+=(p%10);
		p/=10;
	}
	if(N%sum==0)
		printf("Yes");
	else
		printf("No");
	printf("\n");
	return 0;
}

Measured memory_bytes: 128
import java.io.*;

public class Main{
	public static void main(String[] args){
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int ans = 0;
        try {
            String W = reader.readLine();
            while(true){
                String t = reader.readLine();
                String T = t + ' ';

                if(t.equals("END_OF_TEXT")) break;

                for(int i = 0; i < T.length() - W.length(); i++){

                    String S = T.substring(i, i + W.length());
                    if(S.equalsIgnoreCase(W)&Character.isWhitespace(T.charAt(i+W.length()))){
                        if(i - 1 >= 0){
                            if(!Character.isWhitespace(T.charAt(i-1))) continue;
                        }
                        ans++;
                    }
                }
            } 
        }catch (IOException e){
            System.out.println(e);
        }

        System.out.println(ans);
    }
}


Measured memory_bytes: 24364
def main():
    S = input()
    K = int(input())
    seq = []
    prev = S[0]
    cnt = 1
    for c in S[1:]:
        if c == prev:
            cnt += 1
        else:
            seq.append(cnt)
            cnt = 1
            prev = c
    seq.append(cnt)
    ans = 0
    for s in seq[1:len(seq)-1]:
        ans += s//2 * K
    if len(seq) == 1:
        ans = seq[0] * K // 2
    elif S[0] == S[-1]:
        ans += (seq[0] + seq[-1])//2 * (K-1)
        ans += seq[0]//2 + seq[-1]//2
    else:
        ans += seq[0]//2 * K
        ans += seq[-1]//2 * K
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 38384
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr long  double EPS = 1e-8;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;



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

	cin >> N >> M;
	vector<long long int>dp(N, 0);
	dp[0] = 1;
	for (int i = 1; i < N; i++) {
		int by = min(i, (int)N + 1 - i);
		for (int j = N - 1; j >= 0; j--) {
			for (int k = j + by; k < N; k += by) {
				dp[k] += dp[j];
				dp[k] %= M;
			}
		}
	}
	long long int ans = 0;
	for (int i = 0; i < N; i++) {
		ans += dp[i] * (N - i);
		ans %= M;
	}
	cout << ans << endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vii = vector<vi>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
  string s;
  cin >> s;
  ll a = 0;
  ll z = 0;
  rep(i, sz(s)){
    if(s[i]=='A'){
      a = i + 1;
      break;
    }
  }
  for(ll i=sz(s)-1;i>0;i--){
    if(s[i]=='Z'){
      z = i + 1;
      break;
    }
  }
  print(z - a+1);
}

Measured memory_bytes: 640
#include <stdio.h>

int main(int argc, const char * argv[]) {
    
    int n, x;
    int count;
    
    while (1) {
        scanf("%d %d", &n, &x);
        if (n == 0 && x == 0) {
            break;
        }
        count = 0;
        for (int min = 1; min < x/3 && min <= n-2; min++) {
            for (int middle = min+1; middle < x - (min + middle) && middle <= n-1; middle++) {
                if (x - (min + middle) <= n) {
                    count++;
                }
            }
        }
        printf("%d\n", count);
    }
    
    return 0;
}


Measured memory_bytes: 2104
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
typedef long long lint;
using namespace std;

// input N

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

	/*
	条件を満たす長さNの文字列の数を10**9 + 7で割ったあまり

	A, C, G, T 以外の文字を含まない
	AGC を部分文字列として含まない
	隣接する2文字の入れ替えを 1回行うことで上記の条件に違反させることはできない
 */

	/* <==>
	A,C,G,Tのみを含む -> ok


	'AGC'を含まない
	隣接する2文字の入れ替えても違反しない
	*/

	// MAX: (4**100) 通り
	lint ans = 0;

	/*
	A,B,C,Dのみ
	ABCを含まない
	*/
	// a * b % z == (a % z) * (b % z)
	int l[N] = {}; // takes value of 1 to 4

	// かぞえてみる
	/*
	n=1: 4
	n=2: 4*4=16
	n=3: 4*4*4 - 3 = 61
	n=4: 4*4*4*4 -{ABCA,ABCB,ABCC,ABCD,AABC,BABC,CABC,DABC,ABAC,ABBC,ABDC,ABBC,ACBC,ADBC,}


	ABC,BAC,ACB,ABxC,AxBC
	4**4 = 2**8 = 256
	*/
	lint waru = 1000000007;

	/*
	lint three[N] = {}; //ABC,BAC,ACBを含む
	lint four[N] = {};	// ABxC,AxBCを含む
	for (lint i = 0; i < N; i++)
	{
		if (i >= 2)
		{ // three
			three[i] = three[i - 1] + 3;
			if (three[i] > waru)
				three[i] -= waru;

			if (i >= 3)
			{ // four
			}
		}
	}

*/
	/*
	lint mmm = pow(4,100);
	lint mod = pow(10,9) + 7; 
	lint a = mmm % mod;
	cout << pow(4,100) << endl;

	cout << a << endl;
	//	cout << (pow(4,100) % (pow(10,9) + 7)) << endl;
	*/

	lint omg[103][4][4][4] = {};

	omg[0][3][3][3] = 1;
	for (int n = 0; n < N; n++)
	{
		for (int i = 0; i < 4; i++)
		{
			for (int j = 0; j < 4; j++)
			{
				for (int k = 0; k < 4; k++)
				{
					for (int l = 0; l < 4; l++)
					{
						if (l == 2 && i == 1 && j == 0)
							continue;
						if (l == 2 && i == 0 && j == 1)
							continue;
						if (l == 1 && i == 2 && j == 0)
							continue; // 3文字の制約
						if (l == 2 && i == 1 && k == 0)
							continue;
						if (l == 2 && j == 1 && k == 0)
							continue;

						omg[n + 1][l][i][j] += omg[n][i][j][k];
						omg[n + 1][l][i][j] %= waru;
					}
				}
			}
		}
	}
	for (int i = 0; i < 4; i++)
	{
		for (int j = 0; j < 4; j++)
		{
			for (int k = 0; k < 4; k++)
			{
				ans += omg[N][i][j][k];
				ans %= waru;
			}
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a; i<n; i++)
#define repq(i,a,n) for(int i=a; i<=n; i++)
#define repr(i,a,n) for(int i=a; i>=n; i--)
typedef long long int ll;
typedef pair<int, int> pii;
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
constexpr ll MOD = 10000LL;

// digit, mod, prev, neu-up-down, flag
// neu-up-down ... 0 -> neutral, 1 -> up, 2 -> down
ll dp[510][510][10][3][2];

ll solve(string s, int M, int less) {
    memset(dp, 0, sizeof(dp));
    dp[0][0][0][0][0] = 1;

    int N = s.length();
    rep(i,0,N) rep(j,0,M) rep(k,0,10) rep(l,0,3) rep(f,0,2) {
        int lim = f ? 9 : s[i] - '0';

        // neutral (l == 0 and k == 0)
        if(l == 0 && k == 0) {
            rep(x,0,lim+1) {
                int mo = (j*10+x) % M;
                (dp[i+1][mo][x][0][f || x < lim] += dp[i][j][k][l][f]) %= MOD;
            }
        }
        else {
            // (up, neutral) -> down
            if(l == 0 || l == 1) {
                rep(x,0,lim+1) {
                    if(x >= k) continue;
                    int mo = (j*10+x) % M;
                    (dp[i+1][mo][x][2][f || x < lim] += dp[i][j][k][l][f]) %= MOD;
                }
            }
            // (down, neutral) -> up
            if(l == 0 || l == 2) {
                rep(x,0,lim+1) {
                    if(x <= k) continue;
                    int mo = (j*10+x) % M;
                    (dp[i+1][mo][x][1][f || x < lim] += dp[i][j][k][l][f]) %= MOD;
                }
            }
        }
    }

    ll ret = 0;
    rep(k,0,10) rep(l,0,3) rep(f,0,2) {
        if(less == 1 && f == 0) continue;
        (ret += dp[N][0][k][l][f]) %= MOD;
    }
    return ret;
}

int main() {
    string A, B; cin >> A >> B;
    int M; cin >> M;

    ll ra = solve(A, M, 1);
    ll rb = solve(B, M, 0);
    cout << (rb - ra + MOD) % MOD << endl;
    return 0;
}

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

#define FILE
#define fr first
#define se second

using namespace std;

const long long N = 2e5 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;

int n;
int k;
int cnt;
int main()
{
    #ifdef FILEs
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);

    cin >> n >> k;
    while(n > 0){
        cnt ++;
        n /= k;
    }
    cout << cnt << "\n";
}


Measured memory_bytes: 256
def main():
    H,W,M = map(int,input().split())
    dict_ichi = {}
    dict_H = {key:0 for key in range(1,H+1,1)}
    dict_W = {key:0 for key in range(1,W+1,1)}
    for i in range(M):
        h,w = map(int,input().split())
        dict_H[h] += 1
        dict_W[w] += 1
        dict_ichi[(h,w)] = 1
    #print(list)
    maxH = max(dict_H.values())
    maxW = max(dict_W.values())
    wi = [i for i in range(1,W+1,1) if dict_W[i] == maxW]
    #print(retuH,gyoW,wi)
    for h in [i for i in range(1,H+1,1) if dict_H[i] == maxH]:
        for w in wi:
            if (h,w) not in dict_ichi:
                return maxH + maxW
    return maxH + maxW -1

print(main())


Measured memory_bytes: 125828
import java.util.Arrays;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()) {
			int n = sc.nextInt();
			if(n == 0) break;
			int[] a = new int[n];
			for(int i = 0; i < n; i++) {
				a[i] = sc.nextInt();
			}
			Arrays.sort(a);
			int sum = 0;
			for(int i = 1; i < n - 1; i++) {
				sum += a[i];
			}
			System.out.println(sum / (n - 2));
		}
		sc.close();
	}
}


Measured memory_bytes: 28864
#include <cstdio>
#include <string>
#include <iostream>

using namespace std;

int main()
{
	int i;
	string n;
	bool c = false;

	cin >> n;

	for (i = 0; i < n.size(); i++){
		if (n[i] == '9') {
			c = true;
		}
	}

	if (c) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}

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

int main() {
	int H, W;
	cin >> H >> W;
	vector<vector<bool>> Map(H + 2, vector<bool>(W + 2, false));

	for (int i = 1; i < H + 1; i++) {
		for (int j = 1; j < W + 1; j++) {
			char c;
			cin >> c;
			Map[i][j] = c == '#';
		}
	}
	bool Can = true;
	for (int i = 1; i < H + 1; i++) {
		for (int j = 1; j < W + 1; j++) {
			if (                  !Map[i - 1][j] &&
				!Map[i][j - 1] &&  Map[i    ][j] && !Map[i][j + 1] &&
				                  !Map[i + 1][j])
			{
				Can = false;
				break;
			}
		}
		if (!Can) break;
	}
	if (Can) cout << "Yes";
	else cout << "No";
}

Measured memory_bytes: 256
from collections import defaultdict
from collections import deque
from sys import setrecursionlimit
setrecursionlimit(10**9)
N, M = map(int, input().split())
if M % 2 == 1:
  print(-1)
  exit(0)

tree = defaultdict(list)
for i in range(M):
  temp = list(map(int, input().split()))
  tree[temp[0]].append([temp[1], i])
  tree[temp[1]].append([temp[0], i])
usede = [0] * M
visitedv = [0] * (N + 1)
res = []
def dfs(prev, v):
  global usede
  global visitedv
  global res
  
  if visitedv[v] == 1:
    return
  visitedv[v] = 1
  movable = 0
  
  for l in tree[v]:
    w = l[0]
    i = l[1]
    dfs(v, w)
    if usede[i] == 0:
      movable += 1
 
  for l in tree[v]:
    w = l[0]
    i = l[1]
    if w == prev and movable % 2 == 1:
      continue
    if usede[i] == 0:
      res.append((v, w))
      usede[i] = 1
dfs(0, 1)
for v in res:
  print(v[0], v[1])


Measured memory_bytes: 141636
#include<stdio.h>
int main(){
	int A[110][110],i,j,a,b,B[10010],n,k=1;
	scanf("%d%d",&a,&b);
	scanf("%d",&n);
	for(i=1;i<=n;i++) scanf("%d",&B[i]);
	for(i=1;i<=a;i++){
		if(i%2!=0){
			for(j=1;j<=b;j++){
				A[i][j]=k;
				B[k]--;
				if(B[k]==0) k++;
			}
		}
		else{
			for(j=b;j>=1;j--){
				A[i][j]=k;
				B[k]--;
				if(B[k]==0) k++;
			}
		}
	}
	for(i=1;i<=a;i++){
		for(j=1;j<b;j++){
			printf("%d ",A[i][j]);
		}
		printf("%d\n",A[i][b]);
	}
	return 0;
}

Measured memory_bytes: 256
[N, X, Y] = [int(item) for item in input().split()]
X -= 1
Y -= 1
count=[0 for _ in range(N)]
for i in range(N):
    for j in range(i,N):
        count[min(abs(i-j),abs(i-X)+1+abs(Y-j),abs(i-Y)+1+abs(X-j))]+=1
#print(array)


for i in range(1,N):
        print(count[i])

#print(count)

Measured memory_bytes: 48604
import random

def down_score(d, c, last_d, score):
    sum = 0
    for i in range(26):
        sum += c[i]*(d-last_d[i])
        
    return (score - sum)

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

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

    s = [list(map(int, input().split())) for i in range(D)]

    #print(c)

    #print(s)

    last_d = [0 for i in range(26)]
    
    ans = []
    
    score = 0
    
    for i in range(D):
        max = -1000000
        idx = 0
        for j in range(26):
            if max < score + s[i][j] - c[j] * ((i+1)-last_d[j]) and c[j] != 0:
                max = score + s[i][j] - c[j] * ((i+1)-last_d[j])
                idx = j
            elif max == (score + s[i][j] - c[j] * ((i+1)-last_d[j])) and c[j] != 0:
                x = random.random()
                if x < 0.5:
                    idx = j
        last_d[idx] = i+1
        score += s[i][j]
        down_score(i+1,c,last_d,score)
        
        ans.append(idx)

    for i in range(D):
        print(ans[i]+1)

if __name__ == "__main__":
    main()

Measured memory_bytes: 9780
#include <algorithm>
#include <bitset>
#include <complex>
#include <cstdio>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)

typedef long long ll;

const int Inf = 100100100;
const double EPS = 1e-9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<tuple<int, int, int>> t;
    int i;
    int a, b, c;
    int time = 0;
    int count = 0;
    rep(i, 5) {
      cin >> a;
      b = a % 10;
      c = (a / 10 + 1) * 10;
      t.emplace_back(b, a, c);
    }
    sort(t.begin(), t.end());
    rep(i, 5) {
      if (get<0>(t[i]) == 0) {
        time += get<1>(t[i]);
        count++;
      }
    }

    sort(t.begin(), t.end(), greater<tuple<int, int, int>>());

    rep(i, 5 - count) {
      if (i != 5 - count -1) {
        time += get<2>(t[i]);
      } else {
        time += get<1>(t[i]);
      }
    }

    cout << time << '\n';

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i=0; i<(int)(n); i++)

int main(){
  long long X, K, D;
  cin >> X >> K >> D;
  if(X<0) X = -X;
  long long ans = 0;
  long long r = X % D;
  long long a = (X-r) / D;
  if(K-a<0){
    ans = X - K*D;
  }else if((K-a)%2==0){
    ans = r;
  }else{
    ans = D - r;
  }
  cout << ans;
  return 0;
}

Measured memory_bytes: 3568
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int n, t;
int tim[200005];
ll ans;
int main() {
   cin >> n >> t;
   for (int i=0; i<n; i++) {
       cin >> tim[i];
       if (i==0) ans+=t;
       else {
           if (tim[i]<=tim[i-1]+t) ans+=tim[i]-tim[i-1];
           else ans+=t;
       }
    }
    cout << ans;
}

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

using namespace std;

#define int long long
#define pb push_back
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)

signed main () {
  cin.tie(0);
  cout << setprecision(10);

  int h, w; cin >> h >> w;

  vector<vector<char>> a(h);

  char tmp;
  REP(i, h) {
    REP(j, w) {
      cin >> tmp;
      a[i].pb(tmp);
    }
  }

  map<int, int> b, c;

  bool ok = false;
  REP(i, h) {
    ok = false;
    REP(j, w) {
      if(a[i][j] == '#') break;
      if(j == w-1) ok = true;
    }
    if(ok) b[i] = 1;
  }

  REP(i, w) {
    ok = false;
    REP(j, h) {
      if(a[j][i] == '#') break;
      if (j == h-1) ok = true;
    }
    if(ok) c[i] = 1;
  }

  //REP(i, h) //cout << b[i];
  //cout << endl;
  //REP(i, w) //cout << c[i];
  //cout << endl;

  

  REP(i, h) {
    if(b[i] == 1) continue;
    REP(j, w) {
      if(c[j] != 1) cout << a[i][j];
    }
    cout << endl;
  }
}


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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int h, w, n;
	cin >> h >> w >> n;
	int t = max(h, w);
	cout << (n+t-1)/t << endl;
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3


def compute(n, r):
    if n >= 10:
        return r
    else:
        return r + 100 * (10 - n)


def main():
    n, r = (int(z) for z in input().split())
    res = compute(n, r)
    print(res)


if __name__ == "__main__":
    main()


Measured memory_bytes: 2940
S=int(input())

kizon=[S]
#print(kizon)
cnt=1

while True:
    if kizon[-1]%2==0:
        kizon.append(kizon[-1]//2)
        #print(kizon)
        cnt+=1
    else:
        kizon.append(3*kizon[-1]+1)
        cnt+=1
    if len(kizon)!=len(set(kizon)):
        print(cnt)
        break

Measured memory_bytes: 3060
#include <stdio.h>

int main(){
   int N=0;
   int A=0,B=0;
   scanf("%d %d %d",&N,&A,&B);
   if(N*A>B){
      printf("%d\n",B);
   }
   else{
      printf("%d\n",A*N);
   }

   return 0;
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}
fn gcd(m: usize, n:usize) -> usize {
    if n > m {
        gcd(n, m)
    } else if n == 0 {
        m
    } else {
        gcd(n, m % n)
    }
}

fn main() {
    let n: usize = read();
    println!("{}", 2 * n / gcd(2, n));
}


Measured memory_bytes: 4352
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<set>
#include<bitset>
#include<map>

#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)

using namespace std;

typedef long long LL;
typedef double db;

int get(){
	char ch;
	while(ch=getchar(),(ch<'0'||ch>'9')&&ch!='-');
	if (ch=='-'){
		int s=0;
		while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
		return -s;
	}
	int s=ch-'0';
	while(ch=getchar(),ch>='0'&&ch<='9')s=s*10+ch-'0';
	return s;
}

const int N = 3e+5+5;

int n,k;

LL quickmi(LL x,LL tim){LL v=1;for(;tim;tim/=2,x=x*x)if (tim&1)v=v*x;return v;}

int main(){
	k=get();n=get();
	if (k==1){
		fo(i,1,n/2+n%2)printf("1 ");
		return 0;
	}
	if (k%2==0){
		printf("%d ",k/2);
		fo(i,2,n)printf("%d ",k);
		putchar('\n');
	}
	else{
		int pre=0;
		if (n&1)pre=1;
		fd(i,n,1){
			if (log(k)*i>log(1e+12)){
				int px=(pre%2+2)%2,py=i%2;
				//printf("%lld ",((quickmi(k,i+1)-1)/(k-1)-1+pre)/2);
				if (px==0&&py==0)pre--;
				if (px==1&&py==1)pre--;
				printf("%d ",k/2+1);
			}
			else{
				LL cnt=(quickmi(k,i+1)-1)/(k-1)-1+pre;
				cnt=cnt/2;
				fd(j,i,1){
					LL v=(quickmi(k,j)-1)/(k-1);
					int l=1,r=k,w=0;
					while(l<=r){
						int mid=(l+r)/2;
						if (v*mid<cnt)l=mid+1;
						else r=mid-1,w=mid;
					}
					printf("%d ",w);
					//printf("%d ",cnt);
					cnt-=1ll*(w-1)*v;
					if (cnt==1)break;
					cnt--;
				}
				break;
			}
		}
		putchar('\n');
	}
	return 0;
}

Measured memory_bytes: 2304
#include<bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long int ll;
typedef long double ld;
const ll INF=(1LL<<62);
const ld pi=acosl((ld)-1);
const ll mod = 1000000007;
// const ll mod = 1234567;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
#define endn "\n"
#define TO_STRING(VariableName) # VariableName

template <typename T>ostream &operator<<(ostream &out,const vector<T> &v) {rep(i,(int)v.size()-1)cout<<v[i]<<" ";cout<<v[(int)v.size()-1];return out;}
template <typename T1, typename T2>ostream &operator<<(ostream &out, const map<T1, T2> &p) {out << "(" << p.first << ", " << p.second << ")";return out;}
template <typename T1, typename T2>ostream &operator<<(ostream &out, const pair<T1, T2> &p){out << "(" << p.first << ", " << p.second << ")";return out;}
template<class T>void debag(const T &obj){cout<<obj<<endl;}

bool solve(){
  ll n;cin>>n;ll k;cin>>k;
  vector<ll>h(n);
  rep(i,n)cin>>h[i];
  vector<ll>dp(n,INF);
  dp[0]=0;

  rep(i,n){
    for(int j=1;j<=k;j++){
      if(i+j<n)chmin(dp[i+j],dp[i]+abs(h[i+j]-h[i]));
    }
  }

  cout<<dp[n-1]<<endl;

  return false;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout<<fixed<<setprecision(30);
    solve();
}


Measured memory_bytes: 1792
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
#define EPS (1e-5)
#define bit(n,k) ((n>>k)&1)
const ll Mod = 1000000007;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H& b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H & b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H & b) const { return x == b.x && y == b.y; }
	bool operator!=(const H & b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P& b) const { return cost < b.cost; }
	bool operator>(const P& b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E& b) const { return cost < b.cost; }
	bool operator>(const E& b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T & a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T & a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll read() {
	ll u;
	ll k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j % i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
int h, w, n;
int x, y;
string s, t;
bitset<300000>dp, dp2;
signed main() {
	cin >> h >> w >> n >> x >> y >> s >> t;
	int l = 0, r = h + 1;
	for (int i = n - 1; i >= 0; i--) {
		if (l >= r-1) {
			cout << "NO\n";
			return 0;
		}
		if (t[i] == 'U') {
			r++;
		}
		else if (t[i] == 'D') {
			l--;
		}
		l = max(l, 0ll); r = min(r, h + 1);
		if (s[i] == 'U') {
			l++;
		}
		else if (s[i] == 'D') {
			r--;
		}
	}
	if (l >= x || x >= r) {
		cout << "NO\n";
		return 0;
	}
	l = 0, r = w + 1;
	for (int i = n - 1; i >= 0; i--) {
		if (l >= r-1) {
			cout << "NO\n";
			return 0;
		}
		if (t[i] == 'L') {
			r++;
		}
		else if (t[i] == 'R') {
			l--;
		}
		l = max(0ll, l); r = min(w + 1, r);
		if (s[i] == 'L') {
			l++;
		}
		else if (s[i] == 'R') {
			r--;
		}
	}
	if (l >= y || y >= r) {
		cout << "NO\n";
		return 0;
	}
	cout << "YES\n";
}

Measured memory_bytes: 776
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int n = sc.nextInt();
        int [] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = sc.nextInt();
        long m = 1000; long stock = 0; boolean inc = a[0] <= a[1];
        if (inc) {
            long possible = m / a[0];
            stock += possible;
            m -= a[0] * possible;
        }
        for (int i = 0; i < n - 1; i++) {
            if (inc) {
                if (a[i] > a[i + 1]) {
                    m += (stock * a[i]); stock = 0;
                    inc = false;
                }
            } else {
                if (a[i] < a[i + 1]) {
                    long possible = m / a[i];
                    stock += possible;
                    m -= a[i] * possible;
                    inc = true;
                }
            }

        }
        if (inc) {
            m += (stock * a[n - 1]); stock = 0;
        }
        out.println(m);
        out.close();
    }


    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }


    }

}

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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int x;
    int a=0, b=0;
	cin >> x;
	a = x/500;
	x = x%500;
	b = x/5;

    cout << 1000*a + 5*b;
return 0;
}


Measured memory_bytes: 256
import std.algorithm;
import std.range;
import std.stdio;
import std.math;
import std.array;
import std.string;
import std.conv;
import std.typecons;

/// 数列の読み込み
auto readNums() {
	return readln().chomp.split.map!(to!int).array;
}

/// 数の読み込み
auto readNum() {
	return readNums.front;
}

/// 指定行数読み込み
auto readRows(size_t rows) {
	return generate(() => readln().chomp).take(rows).array;
}

auto range(int a, int b, int c, int d) {
    if(a <= c && c <= b) {
        return (a <= d && d <= b) ? tuple(c, d) : tuple(c, b);
    } else if(c <= a && a <= d) {
        return (c <= b && b <= d) ? tuple(a, b) : tuple(a, d);
    }
    return tuple(0, 0);
}

void main() {
    const nums = readNums();
    immutable r = range(nums[0], nums[1], nums[2], nums[3]);
    writefln("%d", r[1] - r[0]);
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;

#define int long long

#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,x,...) x
#define REP1(i, s, cond, cal) for (signed i = signed(s); i cond; i cal)
#define REP2(i, s, n) REP1(i, s, < signed(n), ++)
#define REP3(i, n) REP2(i, 0, n)
#define rep(...) CHOOSE((__VA_ARGS__,REP1,REP2,REP3))(__VA_ARGS__)
#define rrep(i, s) rep(i, s, >= 0, --)

#define all(c) begin(c), end(c)
template<typename T>bool maxup(T& a, const T&& b) { if (a < b) { a = b; return true; }; }
template<typename T>bool maxup(T& a, const T& b) { if (a < b) { a = b; return true; }; }
template<typename T>bool minup(T& a, const T&& b) { if (a > b) { a = b; return true; }; }
template<typename T>bool minup(T& a, const T& b) { if (a > b) { a = b; return true; }; }

#define X first
#define Y second

using VV = vector<vector<int>>;
using V = vector<int>;
using P = pair<int, int>;
using IP = pair<int, P>;

template<typename T>
inline void input(vector<T>& v) { for (auto& x : v) cin >> x; }

void calc() {
	int n, c, k; cin >> n >> c >> k;
	priority_queue<int, vector<int>, greater<int>> que;
	int ans = 0;
	V v(n); input(v);
	sort(all(v));
	rep(i, n) {
		int t = v[i];
		while (que.size() && t > que.top()) {
			ans++;
			rep(i, c * !que.empty()) que.pop();
		}
		que.push(t + k);
	}
	ans += (que.size() + c - 1) / c;
	cout << ans << endl;
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	calc();
#ifdef _MSC_VER
	system("pause");
#endif
}

Measured memory_bytes: 1152
#include <cstdio>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stack>
#include <algorithm>
#include <random>
#include <iomanip>
#include <map>
#include <queue>
#include <functional>
#include <numeric>
#include <chrono>
#include <cstdlib>
using ll = long long;
using namespace std;

const ll MOD = 1e9 + 7;
const double pi = acos(-1);
typedef pair<int, int> P;
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EPS 1e-4
#define OUTPUT(i) (cout << (ll)i << endl)
#define ALL(a) ((a).begin(), (a).end())

bool operator<(const pair<ll, ll> &a, const pair<ll, ll> &b)
{

    if (a.first == b.first)
        return a.second < b.second;

    return a.first < b.first;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    //cout << fixed << setprecision(15);

    int A, B;
    cin >> A >> B;
    if (B % A == 0)
    {
        cout << A + B << endl;
    }
    else
    {
        cout << B - A << endl;
    }
    return 0;
}

Measured memory_bytes: 892
a,b = gets.chomp.split(' ').map(&:to_f)
i=1
while true
    if ((i*0.08).floor == a) && ((i*0.1).floor == b)
        puts i.to_i
        break
    elsif i > 1000000
        puts "-1"
        break
    end
    i+=1
end

Measured memory_bytes: 14356
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 10e9+9
#define EPS 1e-10
#define MAX_N 100100
#define MAX_M 100100

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

string s;

int main(){
	cin >> s;
	if (s.size() < 6){
		cout << "INVALID" << endl;
		return 0;
	}
	REP(i, s.size()){
		if (s[i] >= '0'&&s[i] <= '9')break;
		if (i == s.size() - 1){
			cout << "INVALID" << endl;
			return 0;
		}
	}
	REP(i, s.size()){
		if (s[i] >= 'a'&&s[i] <= 'z')break;
		if (i == s.size() - 1){
			cout << "INVALID" << endl;
			return 0;
		}
	}
	REP(i, s.size()){
		if (s[i] >= 'A'&&s[i] <= 'Z')break;
		if (i == s.size() - 1){
			cout << "INVALID" << endl;
			return 0;
		}
	}
	cout << "VALID" << endl;
}

Measured memory_bytes: 1180
#include<bits/stdc++.h>
using namespace std;
 
#define int long long
#define pb push_back 
#define pf push_front 
#define mp make_pair
#define fr first
#define sc second
#define Rep(i, n) for ( int i = 0 ; i < (n); i++ )
#define All(v) v.begin(), v.end()
 
typedef pair<int, int> Pii; typedef pair<int, Pii> Pip;
const int INF = 1107110711071107;
 
struct BiMatch{
  int n;
  vector<vector<int> > G;
  vector<int> match,used;
   
  BiMatch(){}
  BiMatch(int sz):n(sz),G(sz),match(sz),used(sz){}
   
  void add_edge(int u,int v){
    G[u].push_back(v);
    G[v].push_back(u);
  }
 
  bool dfs(int v){
    used[v]=true;
    for(int i=0;i<(int)G[v].size();i++){
      int u=G[v][i],w=match[u];
      if(w<0||(!used[w]&&dfs(w))){
    match[v]=u;
    match[u]=v;
    return true;
      }
    }
    return false;
  }
 
  int build(){
    int res=0;
    fill(match.begin(),match.end(),-1);
    for(int v=0;v<n;v++){
      if(match[v]<0){
    fill(used.begin(),used.end(),0);
    if(dfs(v)){
      res++;
    }
      }
    }
    return res;
  }
};
 
signed main() {
  int n;
  cin >> n;
 
  BiMatch BM(n+32);
  Rep(i, n) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    for ( int j = a; j <= b; j++ ) {
      BM.add_edge(i, n+j);
    }
  }
 
  cout << 50*31 + 50*BM.build() << endl;
}

Measured memory_bytes: 3200
#include <cstdio>

const int mod = 1e9 + 7;
const int N = 3e6;

using int64 = long long;

int64 fac[N], ifac[N];

int64 binom(int n, int m) {
  return fac[n] * ifac[m] % mod * ifac[n - m] % mod;
}

int64 pow_mod(int64 a, int64 n) {
  int64 r = 1;
  for (; n; n >>= 1) {
    if (n & 1) r = r * a % mod;
    a = a * a % mod;
  }
  return r;
}

int main() {
  int r1, r2, c1, c2;
  scanf("%d%d%d%d", &r1, &c1, &r2, &c2);
  fac[0] = ifac[0] = 1;
  for (int i = 1; i <= r2 + c2 + 1; ++i) {
    fac[i] = fac[i - 1] * i % mod;
    ifac[i] = pow_mod(fac[i], mod - 2);
  }
  int64 ret = 0;
  for (int n = r1; n <= r2; ++n) {
    ret += binom(n + c2 + 1, c2) - binom(n + c1, c1 - 1);
  }
  ret %= mod; ret += mod; ret %= mod;
  printf("%lld\n", ret);
  return 0;
}


Measured memory_bytes: 34944
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main(){
    int N,A=0,B=0;
    cin>>N;
    vector<int> L(N);
    for(int i=0;i<N;i++){
        cin>>L[i];
    }
    //sort
    sort(L.begin(),L.end(),greater<int>());
    for(int i=0;i<N;i++){
        if(i%2==0){
            A+=L[i];
        }else{
            B+=L[i];
        }
    }
    cout <<A-B<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);
#define openfiles ifstream in("input.txt");ofstream out("output.txt");
const int inf=2e9;
const ll infll=1e18;
typedef pair<int,int> pii;
openfiles;
///---------------------------------------------------------------------------
int n,k;
vector<int> vec;
vector<int> razn;
void init()
{
    faster;
    cin>>k>>n;
    vec.resize(n);
    for(int i=0;i<n;i++)
        cin>>vec[i];
    sort(vec.begin(),vec.end());
    for(int i=1;i<n;i++)
        razn.push_back(abs(vec[i]-vec[i-1]));
}
void solve()
{
    sort(razn.begin(),razn.end());
    reverse(razn.begin(),razn.end());
    for(int i=0;i<min((int)razn.size(),k-1);i++)
        razn[i]=0;
    int sum=0;
    for(int i=0;i<razn.size();i++)
        sum+=razn[i];
    cout<<sum;
}

signed main()
{
    init();
    solve();
    return 0;
}


Measured memory_bytes: 1276
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
using ll = long long;
const int mod = 1000000007;
const double PI = acos(-1);

int main()
{
	int n;
	cin >> n;
	int count = 0;
	for (int i = 0; i < n; i++) {
		int d1, d2;
		cin >> d1 >> d2;
		if (d1 == d2) count++;
		else count = 0;
		if (count == 3) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<vector>
#include<set>
#include<iostream>
#define pb push_back
#define fi first
#define se second
#define sz(x)  x.size()
#define cl(x)  x.clear()
#define all(x)  x.begin() , x.end()
#define r(x)  scanf("%d", &x)
#define rr(x , y)  scanf("%d%d" , &x , &y)
#define rst(s)  scanf("%s" , s)
#define rl(x)  scanf("%lld" , &x)
#define rrl(x , y)  scanf("%lld%lld" , &x , &y)
#define w(x)  printf("%d" , x)
#define ww(x , y)  printf("%d %d" , x , y)
#define wl(x)  printf("%lld" , x)
#define wwl(x , y)  printf("%lld %lld" , x , y)
#define sp()  printf(" ")
#define en()  puts("")
#define rep(i , x , n)  for(int i = x ; i <= n ; i ++) 
#define per(i , n , x)  for(int i = n ; i >= x ; i --) 
#define mem0(x)  memset(x , 0 , sizeof(x))
#define mem_1(x)  memset(x , -1 , sizeof(x))
#define mem_inf(x)  memset(x , inf , sizeof(x))
#define mem__inf(x)  memset(x , -inf , sizeof(x))
#define p_queue priority_queue
#define debug(x)  printf("%d\n" , x)
#define ddebug(x , y)  printf("%d %d\n" , x , y)
using namespace std ;
//mt19937  rnd(chrono::high_resolution_clock::now().time_since_epoch().count()) ;
typedef long long ll ;
typedef unsigned long long ull ;
typedef pair<int , int> pii ;
typedef pair<ll , ll> pll ;
typedef pair<int , ll> pil ;
typedef pair<ll , int> pli ;
const int inf = 0x3f3f3f3f ;
const int maxn = 3e5 + 5 ;
const int maxm = 2e6 + 5 ;
const ll mod = 998244353 ;
int main()
{
	int n ;
	r(n) ;
	bool flag = 0 ;
	while(n > 0)
	{
		if(n % 10 == 7)  flag = 1 ;
		n /= 10 ;
	}
	if(flag)  puts("Yes") ;
	else  puts("No") ;
	return 0 ;
}


Measured memory_bytes: 3684
#include<iostream>
using namespace std;
int main () {
  int N;
  cin >> N;
  int ans = N;
  char sli = '0';
  for (int i = 0; i < N; i ++) {
    char c;
    cin >> c;
    if (sli == c) ans --;
    sli = c;
  }
  cout << ans << endl;
}

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

using namespace std;

int main()
{
    int N, M;
    while (cin >> N >> M, N) {
        vector<int> a(N);
        for (int i = 0; i < N; i++) {
            cin >> a[i];
        }
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                a.push_back(a[i] + a[j]);
            }
        }

        sort(a.begin(), a.end());
        
        N = a.size();
        
        int res = 0;
        for (int i = 0; i < N; i++) {
            int m = M - a[i];
            if (m < 0) break;
            
            int l = 0, r = N;
            while (r - l > 1) {
                int mid = (l + r) / 2;
                if (a[mid] < m) {
                    l = mid;
                    res = max(res, a[i] + a[l]);       
                } else {
                    r = mid;
                }
            }
        }
        cout << res << endl;
    }
    return 0;
}

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

typedef long long ll;

int main(void){
	int n,i;
	ll l[100];
	cin >> n;
	l[0]=2;
	l[1]=1;
	for(i=2; i<=n; i++){
		l[i] = l[i-1] + l[i-2]; 
	}
	cout << l[n] << endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int a(int,int);

int main(){
  int x,y;

  scanf("%d%d",&x,&y);
  printf("%d\n",a(x,y));

  return 0;
}

int a(int x,int y){
  int n;
  
  n = y ? a(y,x%y) : x;
  
  return n;
}



Measured memory_bytes: 2144
#include <vector>
#include <iostream>
using namespace std;
int n, a[10001]; 

int gcd(int a, int b) {
    if (a < 0) a = -a;
    if (b < 0) b = -b;
    if (a < b) swap(a, b);
    while (b > 0) {
        int t = a; a = b; b = t % b;
    }
    return a;
}

void check(int p) {
    if (a[0] % p) return;
    for (int i = 1; i <= min(n, p-1); i++) {
        long long sum = 0;
        for (int k = i; k <= n; k += p-1) sum += a[k];
        if (sum % p) { return; }
    }
    cout << p << endl;
}

int main() {
    cin >> n;
    for (int i = 0; i <= n; i++) cin >> a[n-i];

    vector<bool> b(10001, true);
    vector<int> primes;
    for (int p = 2; p < b.size(); p++) {
        if (b[p]) {
            check(p);
            primes.push_back(p);
            for (int q = p*p; q < b.size(); q += p) b[q] = false;
        }
    }
    int g = a[0];
    for (int i = 1; i <= n; i++) g = gcd(a[i], g);
    for (int p : primes) while (g % p == 0) g /= p;
    if (g > 1) cout << g << endl;
}


Measured memory_bytes: 256
using System;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Program
{
    static void Main(string[] args)
    {
        int N = int.Parse(Console.ReadLine());
        Console.WriteLine((N - 2) * 180);
    }
}

Measured memory_bytes: 11092
import numpy as np
n = int(input())
A = list(map(int,input().split()))
a = np.abs(A)
mainasu = 0

for i in range(n):
  if A[i]<0:
    mainasu += 1

if mainasu%2 == 0:
  ans = sum(a)
else:
  a = sorted(a)
  ans = sum(a[1:n]) - a[0]
  
print(ans)
  

Measured memory_bytes: 23268
#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6;
int d()
{
    int ret;
    scanf("%d", &ret);
    return ret;
}
long long lld()
{
    long long ret;
    scanf("%lld", &ret);
    return ret;
}
int main()
{
    int k;
    string s;
    cin>>s>>k;
    set<string>se;
    for(int i=0; i<s.length(); i++)
    {
        string s1="";
        for(int j=i; j< i + 5 && j < s.size(); j++)
        {
            s1+=s[j];
            se.insert(s1);
        }
    }
    int i=1;
    for(auto v:se)
    {
        if(i==k)
        {
            cout<<v<<endl;
        }
        i++;
    }
}


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

using namespace std;

int main()
{
    int n,k,i;
    cin>>n>>k;
    vector<double> arr(n,0);
    for(int i=0;i<n;i++) {
        cin>>arr[i];
        arr[i] = ((arr[i]+1.0)/2.0);
    }
    for(int i=1;i<n;i++) {
        arr[i] += arr[i-1];
    }
    double ans = 0;
    for(int i=k-1;i<n;i++) {
        ans = max(ans,arr[i]-arr[i-k]);
    }
    cout<<setprecision(25)<<ans;
   return 0;
}

Measured memory_bytes: 1792
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	String S = sc.next();
      	String[] Rain = S.split("S");
      	
      	int max_r = 0;
      	for(String r : Rain){
        	if(max_r < r.length()){
            	max_r = r.length();
            }
        }
    System.out.println(max_r);
    }
}

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

#define mod 1000000007

using namespace std;
typedef long long ll; 
 
int main(void){
	
	int N, K;
	ll ans;
	
	cin >> N >> K;
	
	ans = K * pow(K-1, N-1);
	
	cout << ans;
	
	return 0;
}

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

int main(){
    int h,w,n;
    cin >> h >> w >> n;
    if(h < w) swap(h,w);
    if(n%h==0) cout << n/h << endl;
    else cout << n/h+1 << endl;
    return 0;
}


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

template<long long mod>
class ModInt {
public:
	long long v;
	ModInt(long long v = 0) : v((v % mod + mod) % mod) {}
	ModInt operator+(ModInt t) {return ModInt((v + t.v) % mod);}
	ModInt operator-(ModInt t) {return ModInt((v - t.v + mod) % mod);}
	ModInt operator*(ModInt t) {return ModInt((v * t.v) % mod);}
	ModInt operator+=(ModInt t) {return *this = *this + t;} 
	ModInt operator-=(ModInt t) {return *this = *this - t;}
	ModInt operator*=(ModInt t) {return *this = *this * t;}
	ModInt operator-() {return ModInt(-v);}
	ModInt mpow(long long t) {
		if (t == 0) return ModInt(1);
		ModInt a = mpow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}
	ModInt inv() {mpow(mod - 2);}
	ModInt operator/(ModInt t) {return ModInt(v) * inv();}
	ModInt operator/=(ModInt t) {return *this = *this / t;}
	ModInt operator==(ModInt t) {return *this.v == t.v;}
	ModInt operator!=(ModInt t) {return *this.v != t.v;}
	friend ostream& operator<<(ostream& os, const ModInt& mi) {
		os << mi.v;
		return os;
	}
};


using ll = long long;
const ll mod = 1000000007;
using mint = ModInt<mod>;

int d;
mint dp1[100005][100], dp2[100005][100];
//dp1[i][j] := i桁まで見終わったときに次に0~9が使え、i桁までの数字の和のmod100がj




int main() {
	string k;
	cin >> k;
	cin >> d;

	int szk = k.size();
	
	int a[szk + 1];
	for (int i = 1; i <= szk; i++) a[i] = k[i - 1] - '0';

	dp2[0][0] = 1;
	for (int i = 1; i <= szk; i++) {
		for (int j = 0; j < d; j++) {
			for (int x = 0; x < 10; x++) {
				dp1[i][(j + x) % d] += dp1[i - 1][j];
				if (x < a[i]) {
					dp1[i][(j + x) % d] += dp2[i - 1][j];
				}
				if (x == a[i]) {
					dp2[i][(j + x) % d] += dp2[i - 1][j];
				}
			}
		}
	}

	cout << dp1[szk][0] + dp2[szk][0] - 1 << endl;
	return 0;
}

Measured memory_bytes: 159928