akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 998244353;
const ll MAX = 4000001;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

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

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

class mint {
	long long x;
public:
	mint(long long x = 0) : x((x% MOD + MOD) % MOD) {}
	mint operator-() const {
		return mint(-x);
	}
	mint& operator+=(const mint& a) {
		if ((x += a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator-=(const mint& a) {
		if ((x += MOD - a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator*=(const  mint& a) {
		(x *= a.x) %= MOD;
		return *this;
	}
	mint operator+(const mint& a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint& a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint& a) const {
		mint res(*this);
		return res *= a;
	}

	mint operator^(const ll& t)const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}
	// for prime MOD
	mint inv() const {
		return pow(MOD - 2);
	}
	mint& operator/=(const mint& a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint& a) const {
		mint res(*this);
		return res /= a;
	}

	friend ostream& operator<<(ostream& os, const mint& m) {
		os << m.x;
		return os;
	}
};

///////////////////////////

int main() {
	string S;
	cin >> S;

	string T = "CODEFESTIVAL2016";

	ll ans = 0;
	rep(i, 16) if (S[i] != T[i]) { ans++; }

	cout << ans;

	system("PAUSE");
}


Measured memory_bytes: 504
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))

visited = set()
count = 0
next = 1
while True:
  count += 1
  visited.add(next)
  next = a[next-1]
  if next == 2:
    print(count)
    exit(0)
  if next in visited:
    print(-1)
    exit(0)

Measured memory_bytes: 55896
import java.util.Scanner;

fun main (args : Array<String>) {
  val input = Scanner(System.`in`)
  
  while (input.hasNext()) {
    val N = input.nextInt()
    val M = input.nextInt()
    val num = CharArray(N) {'.'}
    var isExist = true
    
    for (i in 1..M) {
      val s = input.nextInt()
      val c = input.nextInt()
      
      if (num[s - 1] == '.') {
        num[s - 1] = (c + '0'.toInt()).toChar()
      } else if (num[s - 1] != (c + '0'.toInt()).toChar()){
        isExist = false
      }
    }
    
    for (i in num.indices) {
      if (num[i] == '.') {
        if (i == 0 && num.size > 1) {
          num[i] = '1'
        } else {
          num[i] = '0'
        }
      }
    }
    
    if (num.size > 1 && num[0] == '0') {
      isExist = false
    }
    
    if (isExist) {
      println(num)
    } else {
      println(-1)
    }
  }
}

Measured memory_bytes: 36452
import java.util.*;

public class Main{
    public static void main(String[] srgs){
        Scanner sc=new Scanner(System.in);

        int n=sc.nextInt();
        String a=sc.next(),b=sc.next();
        for(int i=0;i<n;i++){
            System.out.print(a.charAt(i));
            System.out.print(b.charAt(i));
        }
    }
}


Measured memory_bytes: 21328
#include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main()
{
  int t,n,i,j,k,l,min1=0;
  string s;
  cin>>s;
  for(i=0;i<3;i++)
  {
    if(s[i]=='R')
    {
      for(j=i+1;j<3;j++)
      {
        if(s[j]=='R')
          continue;
          break;
      }
      k=j-i;
      min1=max(min1,k);
    }
  }
  cout<<min1;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define mfill(x,y) memset(x,y,sizeof(x))
#define all(v) v.begin(), v.end()
#define in(x,y,h,w) if(0<=x&&x<h&&0<=y&&y<w)
#define y0 y12345
#define y1 y54321

#ifdef LOCAL
#define debug(...) fprintf(stderr,__VA_ARGS__)
#else
#define debug(...) 42
#endif

using ul = unsigned long;
using ll = long long;
using P = pair<int, int>;
using vint = vector<int>;using vvint = vector<vector<int>>;
using vll = vector<ll>;using vvll = vector<vector<ll>>;
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(a>b){a=b;return 1;}return 0;}
template <class T>void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
	v.assign(a, vector<T>(b, t));
}
template <class T>T gcd(T &a, T &b){if(a<b){swap(a,b);} T r = a%b; while(r!=0){a=b;b=r;r=a%b;} return b;}

vint dx = {-1, 0, 1, 0}, dy = {0, -1, 0, 1};
vint dx8 = {-1, -1, -1, 0, 1, 1, 1, 0}, dy8 = {-1, 0, 1, 1, 1, 0, -1, -1};

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
	debug("debug test\n");
   	int n,m;
	int x,y,z;cin>>x>>y>>z;int k;cin>>k;
	vll a(x), b(y), c(z);
	rep(i, x){cin>>a[i];}//a.push_back(-100000000000);
	rep(i, y){cin>>b[i];}//b.push_back(-100000000000);
	rep(i, z){cin>>c[i];}
	vll ab(x*y);
	//sort(all(a), greater<ll>());
	//sort(all(b), greater<ll>());
	/*int ap=0, bp=0;
	ab.push_back(a[0]+b[0]);
	rep(i, 3000){
		if(ap == x-1 && bp == y-1)break;
		if(a[ap+1]+b[bp]>a[ap]+b[bp+1]){
			ab.push_back(a[ap+1]+b[bp]);
			ap++;
		}else{
			ab.push_back(a[ap]+b[bp+1]);
			bp++;
		}
	}*/
	rep(i, x){
		rep(j, y){
			ab.push_back(a[i]+b[j]);
		}
	}
	sort(all(ab), greater<ll>());
	vll abc(min(3000, x*y)*z);
	rep(i, min(3000, x*y)){
		rep(j, z){
			abc.push_back(ab[i]+c[j]);
		}
	}
	sort(all(abc), greater<ll>());
	rep(i, k){
		cout << abc[i] << endl;
	}
	return 0;
}


Measured memory_bytes: 64888
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;

const int INF = (1<<21);

int main(){
  int n;
  while(cin >> n && n){
    int nn = 0;
    string str;
    getline(cin,str);
    map<string,int> m;
    vector<vector<int> > v;
    v.assign(n*2, vector<int>(n*2,INF));
    while(n--){
      string str2, str3;
      bool f = false, f2 = false, minus = false;
      int a = 0;
      getline(cin,str);

      for(int i=2;i<str.size();i++){
	if(!f && !f2 && str[i] != ' '){
	  str2 += str[i];
	  //str2.insert(str2.size(),1,str[i]);
	}
	else if(!f && !f2 && str[i] == ' '){
	  f = true;
	  i += 6;
	  if(str[i] == '-'){
	    minus = true;
	    i++;
	    a = str[i] - '0';
	    a *= -1;
	  }
	  else a = str[i] - '0';
	}
	else if(!f2 && str[i] != ' '){
	  a *= 10;
	  if(minus) a -= str[i] - '0';
	  else a += str[i] - '0';
	}
	else if(!f2 && str[i] == ' ') f2 = true;
	else{
	  str3 += str[i];
	  //str3.insert(str3.size(),1,str[i]);
	}
      }
      if(m.find(str2) == m.end()) m[str2] = nn++;
      if(m.find(str3) == m.end()) m[str3] = nn++;
      //cout << str2 << " " << str3 << " " << a << endl;
      v[m[str2]][m[str3]] = a;
      v[m[str3]][m[str2]] = -1 * a;
    }

    bool ans = true;

    for(int k=0;k<v.size();k++){
      for(int i=0;i<v.size();i++){
	for(int j=0;j<v.size();j++){
	  if(i != j && v[i][j] == INF && v[i][k] < INF && v[k][j] < INF) v[i][j] = v[i][k] + v[k][j];
	}
      }
    }

    for(int k=0;k<v.size();k++){
      for(int i=0;i<v.size();i++){
	for(int j=0;j<v.size();j++){
	  if(v[i][j] >= INF || v[i][k] >= INF || v[k][j] >= INF) continue;
	  if(v[i][j] != v[i][k] + v[k][j]){
	    ans = false;
	    break;
	  }
	}
	if(!ans) break;
      }
      if(!ans) break;
    }

    /*for(int i=0;i<v.size();i++){
      for(int j=0;j<v.size();j++){
	if(v[i][j] == INF) cout << " I ";
	else printf("%2d ",v[i][j]);
      }
      cout << endl;
      }*/

    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;

  }
  return 0;
}

Measured memory_bytes: 1108
import java.util.*;

class Main {
  public static void main(String[] args) {
	Scanner scanner = new Scanner(System.in);
    
    int x = scanner.nextInt(); //next(文字列), nextDouble, nextLine(1行)とか
	int A[] = new int[x-1];
    for (int i = 0; i<x-1; i++){
      A[i] = scanner.nextInt();
    }
    int B[] = new int[x];
    for (int i = 0; i<x-1; i++){
      B[A[i]-1]++;
    }
    
    for (int z:B){
      System.out.println(z);
    }        
  }
}


Measured memory_bytes: 62716
#include <stdio.h>
#include <cmath>

using namespace std;

int steps[999999] = {0};
int degree[999999] = {0};

double toRadian(int d) {
    const double ONE_RAD = 180.0d / M_PI;
    return ((double) d) / ONE_RAD;
}

int main() {
    double x = 0.0d;
    double y = 0.0d;
    double rot = M_PI / 2.0d;
    int counts = 0;
    while (true) {
        scanf("%d,%d", &steps[counts], &degree[counts]);
        if ((steps[counts] == 0) && (degree[counts] == 0)) {
            break;
        }

        counts++;
    }

    for (int i = 0; i < counts; ++i) {
        double tempX = 0.0d;
        double tempY = 0.0d;
        tempX = (double) steps[i] * cos(rot);
        tempY = (double) steps[i] * sin(rot);
        double rad = toRadian(degree[i]);
        rot -=  rad;

        x += tempX;
        y += tempY;
    }

    int resultX = (int) x;
    int resultY = (int) y;
    printf("%d\n%d\n", resultX, resultY);

    return 0;
}

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

int main(void){
  int r, g, b, n;
  int ans;
  
  cin >> r >> g >> b >> n;
  ans = 0;
  for (int i=0; i*r<=n; i++){
    for (int j=0; i*r+j*g<=n; j++){
      if ((n-i*r-j*g)%b==0){
//        cout << i << " " << j << " " << (n-i*r-j*g) << endl;
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


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

void YorN(bool a){cout << (a?"YES":"NO") << endl ;}

int main(){
	string s ; cin >> s ;
	if(s.size()==1) YorN(1) ;
	else if(s.size()==2) YorN(s.at(0)!=s.at(1)) ;
	else if(s.size()==3) YorN(s.at(0)!=s.at(1)&&s.at(1)!=s.at(2)&&s.at(2)!=s.at(0)) ;
	else{
		int a,b,c ;
		a = b = c = 0 ;
		for(int i=0;i<s.size();i++){
			if(s.at(i)=='a') a++ ;
			else if(s.at(i)=='b') b++ ;
			else c++ ;
		}
		int n = s.size()/3 ;
		YorN((a==n||a==n+1)&&(b==n||b==n+1)&&(c==n||c==n+1)) ;
	}
}


Measured memory_bytes: 512
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _0188
{
    public class Program

    {
        public static void Main(string[] args)
        {
            while (true)
            {
                int n = RInt(); if (n == 0) break;
                int[] nums = new int[n];
                for (int i = 0 ; i < n ; i++)
                {
                    nums[i] = RInt();
                }

                int target = RInt();

                int cnt = 0;
                int left = 0;
                int right = n - 1;

                while (right - left >= 0)
                {
                    cnt++;
                    int mid = (left + right) / 2;
                    if (nums[mid] == target) break;
                    else if (nums[mid] < target) left = mid + 1;
                    else right = mid - 1;
                   
                }

                Console.WriteLine(cnt);

            }
        }

        static string RSt() { return Console.ReadLine(); }
        static int RInt() { return int.Parse(Console.ReadLine().Trim()); }
        static long RLong() { return long.Parse(Console.ReadLine().Trim()); }
        static double RDouble() { return double.Parse(Console.ReadLine()); }
        static string[] RStAr(char sep = ' ') { return Console.ReadLine().Trim().Split(sep); }
        static int[] RIntAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => int.Parse(e)); }
        static long[] RLongAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => long.Parse(e)); }
        static double[] RDoubleAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => double.Parse(e)); }
        static string WAr<T>(IEnumerable<T> array, string sep = " ") { return string.Join(sep, array.Select(x => x.ToString()).ToArray()); }
    }

}



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

int main() {
    int n, tmp;
    int id[100000];
    cin >> n;
    for(int i = 1; i <= n; ++i){
        cin >> tmp; 
        id[tmp-1] = i;
    }
    for(int i = 0; i < n; ++i){
        cout << id[i] << " ";
    }
    cout << "\n";
    return 0;
}

Measured memory_bytes: 1152
#include <iostream>
#include <stdio.h>
using namespace std;

int main(void){
  long n,m,l;
  long a[100][100];
  long b[100][100];
  long c[110][110];
  cin >> n >> m >> l;
  for (int i=0;i<n;i++) {
    for (int j=0;j<m;j++) {
      cin >> a[i][j];
    }
  }
  for (int i=0;i<m;i++) {
    for (int j=0;j<l;j++) {
      cin >> b[i][j];
    }
  }

  for (int i=0;i<n;i++) {
    for (int j=0;j<l;j++) {
      for (int k=0;k<m;k++) {
        c[i][j] += (a[i][k] * b[k][j]);
      }
      if (j==l-1) cout << c[i][j];
      else cout << c[i][j] << " ";
    }
    cout << endl;
  }
}


Measured memory_bytes: 3344
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a


inf = 10 ** 18
mod = 10 ** 9 + 7

s = input()
K = ir()
ind = len(s)-1
while ind > 0 and s[ind] == s[ind-1]:
    ind-=1
if ind == 0:
    print(len(s)*K//2)
else:
    tmp = ''.join([s[ind:], s[:ind]])
    k = 0
    ans_div = 0
    pre = ''
    for c in tmp:
        if c != pre:
            ans_div+=((k+1)//2)
            k=0
        else:
            k+=1
        pre = c
    ans_div +=((k+1)//2)
    fir = s[:ind]
    firc = 0
    las = s[ind:]
    lasc = 0
    k = 0
    pre = ''
    for c in fir:
        if c != pre:
            firc+=((k+1)//2)
            k=0
        else:
            k+=1
        pre = c
    firc += ((k+1)//2)
    k = 0
    pre = ''
    for c in las:
        if c != pre:
            lasc+=((k+1)//2)
            k=0
        else:
            k+=1
        pre = c
    lasc += ((k+1)//2)
    print(firc+lasc+ans_div*(K-1))

Measured memory_bytes: 77472
#include<stdio.h>
int main()
{
	char s[4],t[4];
	int i,c=0;
	scanf("%s %s",s,t);
	for(i=0;i<3;i++){
		if(s[i]==t[i]) c++;
	}
	printf("%d\n",c);
	return 0;
}


Measured memory_bytes: 1732
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VV(T, a, b, c) vector<vector<T>>(a, vector<T>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define VVV(T, a, b, c, d)                                                     \
  vector<vector<vector<T>>>(a, vector<vector<T>>(b, vector<T>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll X, Y, ans = 0;
  cin >> X >> Y;
  if (X == 1)
    ans += 300000;
  if (X == 2)
    ans += 200000;
  if (X == 3)
    ans += 100000;
  if (Y == 1)
    ans += 300000;
  if (Y == 2)
    ans += 200000;
  if (Y == 3)
    ans += 100000;
  if (X + Y == 2)
    ans += 400000;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 764
/*
 *  B - Tap Dance
 * author: roy4801
 * (C++)
 */
#include <bits/stdc++.h>

using namespace std;

#define PROB "B"
#define TESTC ""

#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
typedef long long int LL;
typedef unsigned long long ULL;
typedef pair<int, int> P;
typedef pair<LL, LL> PLL;
#define F first
#define S second
#define INF 0x3f3f3f3f
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define PPB pop_back
#define PF push_front
#define PPF pop_front
string s;
int main()
{
	#ifdef DBG
	freopen("./testdata/" PROB TESTC ".in", "r", stdin);
	freopen("./testdata/" PROB ".out", "w", stdout);
	#endif
	while(cin >> s)
	{
		bool fail = false;
		for(int i = 0; i < s.size(); i++)
		{
			if((i+1) % 2 != 0) // odd
			{
				if(s[i] == 'L')
					fail = true;
			}
			else
			{
				if(s[i] == 'R')
					fail = true;
			}
			if(fail) break;
		}
		if(fail)
			puts("No");
		else
			puts("Yes");
	}

	return 0;
}

Measured memory_bytes: 256
import math
X =int(input())
Sqx = int(math.sqrt(X))
A=0
while A==0:
    for i in range(0,1000):
        if A != 0:
            break
        P = X
        P += i
        for j in range(2,Sqx+10):
            if P % j == 0:
                if P == j:
                    A = P
                    break
                else:
                    break
            elif j == Sqx:
                A = P
                break
print(A)

Measured memory_bytes: 3060
A=int(input())
B=int(input())
C=int(input())
X=int(input())

T=0
for a in range(A+1):
    for b in range(B+1):
        for c in range(C+1):
            if 500*a+100*b+50*c==X:
                T+=1

print(T)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define MOD (int)(1e9+7)
#define ceil(x, y) (x%y==0? (x/y) : (x/y+1))
#define FOR(i, N) for(int i = 0; i < N; ++i)
#define FOR1(i, N) for(int i = 1; i <= N; ++i)
#define vi vector <int>
#define pii pair <int, int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mset(a, v) memset(a, v, sizeof(a))
#define all(v) (v).begin(), (v).end()
#define INF 2e9
#define EPS 1e-9
#define PI 3.141592653589793238
#define int long long
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef cc_hash_table<int, int, hash<int>> ht; // while using, comment #define int long long  */

void __print(int x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif
using namespace std;
#define MAXN 10000009
int pre[MAXN];
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    	freopen("in3.txt", "r", stdin);
    	freopen("out.txt", "w", stdout);
    #endif

	int T=1;
	//cin >> T;
	for(int i = 1; i < MAXN; i++){
		for(int j = 1; j*i < MAXN; j++){
			pre[j*i] += 1;
		}
	}
	FOR1(tt, T)
	{
		//cout << "Case #" << tt << ": ";
		int n; cin >> n;
		int ans = 0;
		for(int i = 1; i <= n; i++){
			// cout << divCount(i) << " ";
			// ans += i*divCount(i);
			//cout << pre[i];
			ans += i*pre[i];
		}
		cout << ans;
		cout << '\n';
	}
	return 0;
}


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

int main() {
  int N;
  cin >> N;
  
  vector<int> mochi(N);
  for (int i = 0; i < N; i++) {
    cin >> mochi.at(i);
  }
  
  sort(mochi.begin(), mochi.end());
  
  mochi.erase(unique(mochi.begin(), mochi.end()), mochi.end());
  
  cout << mochi.size() << endl;
}


Measured memory_bytes: 3604
#include <iostream>
#include <algorithm>
using namespace std;
int a[100005];
int main(int argc, char** argv) {
	int n,m,s=0;
	cin >> n >> m;
	for(int i=1;i<=n;i++)
	{
		cin >> a[i];
		s+=a[i];
	}
	sort(a+1,a+n+1);
	int qwq=s/(4*m);
	if(s%(4*m)) ++qwq;
	if(a[n-m+1]<qwq) cout << "No";
	else cout << "Yes";
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <queue>
#include <cstring>
using namespace std;

const long long mod = pow(10, 9) + 7;

int main() {
	int N, K; cin >> N >> K;
	vector<double> p(N);
	for (int i = 0; i < N; i++) {
		cin >> p[i]; p[i] = (1 + p[i]) / 2;
	}
	double x = 0;
	for (int i = 0; i < K; i++)x += p[i];
	double ma = x;
	for (int i = K; i < N; i++) {
		x += p[i]; x -= p[i - K];
		ma = max(ma, x);
	}
	printf("%.10f", ma);
}





Measured memory_bytes: 1792
#include<iostream>
using namespace std;
int main(){
	int a,b,i;
	for(i=0;i<3000;i++){
	cin>>a>>b;
	if(a==0&&b==0){
	break;
	}
	if(b<a){
	swap(a,b);
	}
	cout<<a<<" "<<b<<endl; 
	}
return 0;
}


Measured memory_bytes: 2964
#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <cstdlib>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()
#pragma endregion


int main()
{
	int n, t; cin >> n >> t;
	vector<int> a(n), b(n);
	rep(i, n)cin >> a[i] >> b[i];
	vector<vector<int>> dp(n + 1, vector<int>(t)), rdp(n + 1, vector<int>(t));
	rep(i, n)rep(j, t)
	{
		if (j + a[i] < t)dp[i + 1][j + a[i]] = max(dp[i + 1][j + a[i]], dp[i][j] + b[i]);
		dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
	}
	rrep(i, n)rep(j, t)
	{
		if (j + a[i] < t)rdp[i][j + a[i]] = max(rdp[i][j + a[i]], rdp[i + 1][j] + b[i]);
		rdp[i][j] = max(rdp[i][j], rdp[i + 1][j]);
	}
	int res = 0;
	rep(i, n)
	{
		int tmp = 0;
		rep(j, t)
		{
			tmp = max(tmp, dp[i][j] + rdp[i + 1][t - 1 - j]);
		}
		res = max(res, tmp + b[i]);
	}
	cout << res << endl;
}

Measured memory_bytes: 70912
#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 double EPS = 1e-12;

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


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

	string s, t, u;
	while (cin >> s, s != "0") {
		cin >> t >> u;
		long long int dp[51][10][10][10][2] = {};
		dp[0][0][0][0][0] = 1;
		reverse(s.begin(), s.end());
		reverse(t.begin(), t.end());
		reverse(u.begin(), u.end());
		for (int i = 0; i < s.size(); i++) {
			for (int j = 0; j < 10; j++) {
				for (int k = 0; k < 10; k++) {
					for (int l = 0; l < 10; l++) {
						for (int m = 0; m < 2; m++) {
							for (int a = 0; a < 10; a++) {
								if (i + 1 == s.size() && a == 0)continue;
								if (s[i] != a + '0'&&s[i] != '?')continue;
								for (int b = 0; b < 10; b++) {
									if (i + 1 == s.size() && b == 0)continue;
									if (t[i] != b + '0'&&t[i] != '?')continue;
									int c = (a + b + m) % 10;
									int d = (a + b + m) / 10;
									if (u[i] != c + '0'&&u[i] != '?')continue;
									dp[i + 1][a][b][c][d] += dp[i][j][k][l][m];
									dp[i + 1][a][b][c][d] %= MOD;
								}
							}
						}
					}
				}
			}
		}
		long long int ans = 0;
		for (int i = 0; i < 10; i++) {
			for (int j = 0; j < 10; j++) {
				for (int k = 0; k < 10; k++) {
					ans += dp[s.size()][i][j][k][0];
					ans %= MOD;
				}
			}
		}
		cout << ans << endl;
	}
}


Measured memory_bytes: 3816
N,D,A=map(int, input().split())
B=[list(map(int, input().split())) for _ in range(N)]
C=sorted(B)
d,E=zip(*C)
import bisect
Damage=[0]*N
for i in range(N):
  e=bisect.bisect_right(d,d[i]+2*D)
  Damage[i]=e
dd=[0]*(N+1)
cnt=0
for i in range(N):
  if i!=0:
    dd[i]+=dd[i-1]
  h=E[i]
  h-=dd[i]
  if h>0:
    bomb=-(-h//A)
    cnt+=bomb
    dd[i]+=A*bomb
    dd[Damage[i]]-=A*bomb
print(cnt)

Measured memory_bytes: 72344
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <math.h>
#include <cmath>
#include <set>   

using namespace std;


int main() {

	string a, b, c;

	cin >> a >> b >> c;

	if (a[a.size() -1] == b[0] && b[b.size() - 1] == c[0]) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;

	}

}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
import numpy as np
from collections import defaultdict

# 最後に置いたものは赤とする（3倍）
# 青、緑を最後にいつ置いたのかを持ってdp

MOD = 10 ** 9 + 7
N,M = map(int,input().split())
LRX = [[int(x) for x in input().split()] for _ in range(M)]

R_to_LX = defaultdict(list)
for l,r,x in LRX:
    R_to_LX[r].append((l,x))

# 1個目を置いた時点
for n in range(1,N+1):
    if n == 1:
        dp = np.zeros((n,n), dtype = np.int64)
        dp[0,0] = 1
    else:
        prev = dp
        dp = np.zeros((n,n), dtype = np.int64)
        # 同色
        dp[:-1,:-1] = prev
        # 青から赤に
        dp[n-1,:-1] = prev.sum(axis = 0)
        # 緑から赤に
        dp[:-1,n-1] = prev.sum(axis = 1)
    # ルール違反を除外する
    for l,x in R_to_LX[n]:
        if x == 1:
            dp[l:,:] = 0
            dp[:,l:] = 0
        elif x == 2:
            dp[l:,l:] = 0
            dp[:l,:l] = 0
        elif x == 3:
            dp[:l,:] = 0
            dp[:,:l] = 0
    dp %= MOD

answer = dp.sum() * 3 % MOD
print(answer)

Measured memory_bytes: 13980
#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int *a=new int[n+1];
	int *cnt=new int[n+1];
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		cnt[a[i]]=i;
	}
	sort(a+1,a+n+1);
	for(int i=1;i<=n;i++)
	{
		if(i<n)
		{
			cout<<cnt[a[i]]<<" ";
		}
		else
		{
			cout<<cnt[a[i]]<<endl;
		}
			
	} 
	return 0;
}

Measured memory_bytes: 1664
a, b, c, n = io.read("*n", "*n", "*n", "*n")
t = {}
for i = 1, n + 1 do
  t[i] = 0
end
-- f(x) * (1-x^a)(1-x^b)(1-x^c) = 1
t[1] = 1
for i = 2, n + 1 do
  v = 0
  if a < i then v = v - t[i - a] end
  if b < i then v = v - t[i - b] end
  if c < i then v = v - t[i - c] end
  if a + b < i then v = v + t[i - a - b] end
  if b + c < i then v = v + t[i - b - c] end
  if c + a < i then v = v + t[i - c - a] end
  if a + b + c < i then v = v - t[i - a - b - c] end
  t[i] = -v
end
print(t[n + 1])


Measured memory_bytes: 760
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
const int mod=1e9+7;
ll fun(ll x, ll y){
    if(y==0) return 1;
    ll g=fun(x,y/2);
    g*=g;
    g%=mod;
    if(y&1) g*=x;
    return g%mod;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int a,b;
    cin>>a>>b;
    if(b >= a) cout<<"unsafe\n";
    else cout<<"safe\n";
}

Measured memory_bytes: 3636
#include<iostream>
#include <cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=(1LL<<63) - 600;
const ll mod=1e9+7 ;
const int MAX = 1000000;
const int MOD = 1000000007;

ll  fact(int i, int j){
    ll fac = 1;
    for(int k=i; k>i-j; k--){
      fac*=k; fac%=MOD;
    }
    return fac;
  }

int main(){
  int N, M; cin >> N >> M; int a[N], b[M];
  rep(i, N){
    cin >> a[i];
  }
  rep(i, M){
    cin >> b[i];
  }
  map<int, int> mp; int check[N*M+100] = {};
  rep(i, N){
    rep(j, M){
      int k = min(a[i], b[j]);
      if(a[i]==b[j]){check[a[i]]++;}
      if(check[a[i]]>1){ cout << 0 << endl; return 0;}
      mp[k]++;
    }
  }
  ll mx=0, ans=1;
  for(auto i: mp){
    //cout << i.first << " " << i.second << endl;
    if(check[i.first]){
      ans*=fact(i.first-1-mx, i.second-1); ans%=MOD; mx+=i.second; 
      //cout << "check" << fact(i.first-1-mx, i.second-1) << endl;
      continue;
    }
    ll tmp=fact(i.first-mx, i.second)-fact(i.first-mx-1, i.second);
    if(tmp<0) tmp+=MOD; tmp%=MOD;
    //cout << tmp << endl;
    ans*=tmp;
    ans%=MOD; mx+=i.second;
  }
  cout << ans << endl;
}

Measured memory_bytes: 4224
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <ctime>
 
using namespace std;
 
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
 
long gcd(long a, long b){
	if (a%b==0){
		return b;
	}
	else{
		return gcd(b,a%b);
	}
}
 
long lcm(long a, long b){
	return (a*b) / gcd(a,b);
}
 
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a > b) { a = b; return 1; } return 0; }
 
typedef long long ll;
 
const ll INF = 1ll<<60;
const ll MOD = 1000000007;
const double EPS = 1e-10;

int main(){
	int n, a;
	
	cin >> n >> a;
	
	cout << n*n - a << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<bits/stdc++.h>
using namespace std;
#define rep(i,l,r) for(int i = l;i < r;i++)
#define de(x) cout<<#x<<" = "<<x<<endl
int main()
{
	int n,t;
	cin>>n;
	int a[105] = {0},ans = 0;
	rep(i,0,n){
		cin>>t;
		if(a[t] == 0) ans++;
		a[t] = 1;
	} 
	cout<<ans<<endl;
	return 0;
} 

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define N 100000
typedef long long ll;
int main(){
	ll n;
	cin>>n;
	ll ans=0;
	vector<ll> s(5);
	rep(i,5){
		cin>>s.at(i);
	}
	ans=(ll)n/s.at(0);
	if((ll)n%s.at(0)!=0){
			ans++;
		}
		ll min=s.at(0);
	rep(k,4){
		//cout<<ans<<endl;
		if(min<=s.at(k+1)){
			ans++;
		}else{
			min=s.at(k+1);
			ans=(ll)n/s.at(k+1);
			ans+=k+1;
			if((ll)n%s.at(k+1)!=0){
			ans++;
		}
		}
		
	}
	cout<<ans<<endl;
	return 0;
}

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

//debug
//--------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//IO accelerate
//--------------------------------------------
struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

//template
//--------------------------------------------
template<typename T>
istream& operator >>(istream& is, vector<T>& vec) {
  for(T& x: vec) is >> x;
  return is;
}
template<typename T>
ostream& operator <<(ostream& os, const vector<T>& vec) {
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : "\t" );
  }
  return os;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<vector<T>>& vv) {
	for (int i = 0; i < vv.size(); ++i) {
		s << vv[i] << endl;
	}
	return s;
}

// 多重vector
// auto dp=make_v<int>(4,h,w) みたいに使える
template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

// 多重vectorのためのfill
// fill_v(dp,0) みたいに使える
template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}

//main code

int main(int argc, char *argv[])
{
	string s;
	cin >> s;
	auto check = [&](){
		int n = s.size()/2;
		for (int i = 0; i < n; i++) {
			if (s[i] != s[i+n]) {return false;}
		}
		return true;
	};
	s.pop_back();
	s.pop_back();
	while (!check()) {
		s.pop_back();
		s.pop_back();
	}
	cout << s.size() << endl;
	return 0;
}


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

namespace ProgramingStydying
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split().Select(int.Parse).ToList();
            var n = input[0];
            var c = input[1];
            var k = input[2];

            var arrivalTimes = new List<int>();
            for(int i = 0; i < n; i++)
            {
                arrivalTimes.Add(int.Parse(Console.ReadLine()));
            }

            arrivalTimes.Sort();
            var firstCustomer = arrivalTimes[0];
            var passengers = 1;
            var ans = 1;

            for(int i = 1; i < n ; i++)
            {
                if (passengers < c 
                    && firstCustomer <= arrivalTimes[i] 
                    && arrivalTimes[i] <= firstCustomer + k)
                {
                    passengers++;
                }
                else
                {
                    firstCustomer = arrivalTimes[i];
                    ans++;
                    passengers = 1;
                }
            }
            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 32996
#include "bits/stdc++.h"
using namespace std;
using ll=long long;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<ll,ll>
#define vl vector<ll>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvl vector<vector<ll>>
#define print(n) cout<<n<<endl
const int M=100111;
const int inf=1000000007;
const long long INF=1000000000000000007;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
int ddx[8]={1,-1,0,0,1,-1,-1,1},ddy[8]={0,0,1,-1,1,-1,1,-1};


int main(){
	int n,k,a[101];
	cin>>n>>k;
	rep(i,0,n)cin>>a[i];
	//Firstが勝つ場合1.
	bool dp[M]={};
	rep(i,1,k+1)rep(j,0,n)
		if(i-a[j]>=0&&dp[i-a[j]]==false)
			dp[i]=true;
	if(dp[k]?print("First"):print("Second"));	
}

Measured memory_bytes: 384
'use strict'
const Main = (arg) => {
  let input = arg.trim().split('\n');
  let A = parseInt(input[0]);
  let B = parseInt(input[1]);
  // console.log({ A, B });
  console.log(6 - A - B);


}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 21064
N, M = map(int, input().split())
min = 0
max = N
for i in range(M):
    L, R = map(int, input().split())
    if L > min:
        min = L
    if R < max:
        max = R
ans = max - min + 1
if ans < 0:
    ans = 0
print("{}".format(ans))


Measured memory_bytes: 3060
//HOW YOU DOI'N........................JT
//Could this code be more bad..........CB
//I know...............................MG
//Hii..................................RG
//Noooooooo............................RG
//I wish I could but I don't want to...PB

//That's what she said.................MS


#include <bits/stdc++.h>

#define fast                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0);

#define ll long long
#define ld long double
#define pb push_back
#define mkpr make_pair
#define fi(i,a,b) for (ll i=a;i<b;i++)
#define vll vector<ll>
#define vch vector<char>
#define vst vector<string>
#define vpll vector<pll>
#define vvl vector<vector<ll>>
#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())
#define rsrt(v) sort(v.rbegin(), v.rend())
#define mxe(v) *max_element(v.begin(),v.end())
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ff first
#define ss second
#define mll map<ll, ll>
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) ((a)*1ll * (b)) / gcd(a, b)
#define nl "\n"
#define sp " "
#define sz(x)  (int)x.size()

using namespace std;

double PI = (acos(-1));
ll md = 1000000007;
//ll md = 998244353;

ll pw(ll a, ll b){ll c=1,m=a;while (b){if (b&1)c=(c*m);m=(m*m);b/=2;}return c;}
ll pwmd(ll a, ll b){ll c = 1, m = a;while (b){if (b & 1)c = ((c * m)) % md;m = (m * m) % md;b /= 2;}return c;}
ll modinv(ll n){return pwmd(n, md - 2);}
ll min(ll a,ll b){if(a>=b)return b;return a;}
ll nc2(ll n){return (1ll * n * (n - 1)) / 2;}
ll nsum(ll n){return (1ll * n * (n + 1)) / 2;}
bool prime(ll a){for(int i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}

#define MAX_SIZE 1005
void Sieve(vector<int> &primes){bool IsPrime[MAX_SIZE];memset(IsPrime, true, sizeof(IsPrime));
for (int p = 2; p * p < MAX_SIZE; p++){if (IsPrime[p] == true){
			for (int i = p * p; i < MAX_SIZE; i += p)IsPrime[i] = false;}}
	for (int p = 2; p < MAX_SIZE; p++)if (IsPrime[p])primes.push_back(p);}


vector<char> sml={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char> cap={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};



// Lets start ...

void solve(){
    string s;
    cin>>s;
    fi(i,0,sz(s)){
        if(s[i]=='7'){
            cout<<"Yes";
            return;
        }
    }
    cout<<"No";

}



int main(){
    //vector<int> primes;
    //Sieve(primes);

    fast
    ll tests=1;
    //cin>>tests;
    while(tests--){
        solve();
    }

    return 0;
    }

// Done:)









Measured memory_bytes: 3632
#include <stdio.h>
#include <cctype>
#include <limits.h>
#include <math.h>
#include <complex>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x);
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))

const int INF = 1000000000;
const double EPS = 1e-8;
const double PI = 3.14159;
int dx[4]={-1, 0, 1, 0}, dy[4]={0, -1, 0, 1};
using namespace std;
//typedef pair<int, int> P;

/** Problem0573 : Night Market **/
vector<int> A, B;
int N, T, S;
int dp[3001][3001];

int solve(int time, int market)
{
	if (time>T || market>N)
		return 0;
	
	if (dp[time][market]>=0)
		return dp[time][market];
	
	// 遊ばない
	int res = solve(time, market+1);
	
	// 遊ぶ
	if (time <= S) {
		if (time + B[market] <= S)
			res = max(res, A[market] + solve(time+B[market], market+1));
		else if (S + B[market] <= T)
			res = max(res, A[market] + solve(S+B[market], market+1));
	} else {
		if (time + B[market] <= T)
			res = max(res, A[market] + solve(time+B[market], market+1));
	}
	
	return dp[time][market] = res;
}

int main()
{
	cin>>N>>T>>S;
	A.resize(N);
	B.resize(N);
	memset(dp, -1, sizeof(dp));
	rep(i, N) {
		cin>>A[i]>>B[i];
	}
	cout << solve(0, 0) << endl;
}

Measured memory_bytes: 36588
n, m = map(int, input().split())
arr = [list(map(int, input().split()))[1:] for i in range(n)]
cnt = [0 for i in range(m)]
for v in arr:
    for vi in v:
        cnt[vi - 1] += 1
# print(cnt)
ans = 0
for ci in cnt:
    if ci == n:
        ans += 1
print(ans)


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

int main(){
    int N; cin >> N;
    if(N<=3 || N==5 || N==6 || N==9 || N==10 || N==13 || N==17){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int min(int a, int b)
{
    return (b > a ? a : b);
}

int main(void)
{
    int i, j, k;
    int n;
    int div[10001];
    static int dp[2][5001][2];
    
    scanf("%d", &n);
    
    for (i = 1; i <= n - 1; i++){
        scanf("%d", &div[i]);
    }
    memset(dp, 1, sizeof(dp));
    dp[0][0][0] = dp[0][0][1] = 0;
    
    for (i = 0; i <= n / 2; i++){
        for (j = 0; j <= n / 2; j++){
            if (i > 0){
                dp[i & 1][j][0] = dp[(i - 1) & 1][j][0];
                dp[i & 1][j][1] = dp[(i - 1) & 1][j][0] + div[i + j];
            }
            if (j > 0){
                dp[i & 1][j][0] = min(dp[i & 1][j][0], dp[i & 1][j - 1][1] + div[i + j]);
                dp[i & 1][j][1] = min(dp[i & 1][j][1], dp[i & 1][j - 1][1]);
            }
        }
    }
    
    printf("%d\n", min(dp[0][n / 2][0], dp[0][n / 2][1]));
    
    return (0);
}

Measured memory_bytes: 484
#include<bits/stdc++.h>
using namespace std;
const double eps=1e-10;
int sign(double x){
    if(fabs(x)<=eps)return 0;return x>0?1:0;}
struct Point{
    double x,y;
    Point(double _x=0,double _y=0):x(_x),y(_y){}
    Point operator + (Point p){return Point(x+p.x,y+p.y);}
    Point operator - (Point p){return Point(x-p.x,y-p.y);}
    Point operator * (double k){return Point(x*k,y*k);}
    Point operator / (double k){return Point(x/k,y/k);}
    double norm(){return x*x+y*y;}
    double abs(){return sqrt(norm());}
    bool operator < (const Point &p){return x<p.x||(x==p.x&&y<p.y);}
};
typedef Point Vector;
double dot(Vector a,Vector b){return a.x*b.x+a.y*b.y;}
double cross(Vector a,Vector b){return a.x*b.y-a.y*b.x;}
struct Circle{
    Point c;
    double r;
    Circle(Point _c=Point(),double _r=0):c(_c),r(_r){}
    Point point(double a){return Point(c.x+cos(a)*r,c.y+sin(a)*r);}
};
Point rotate(Point base,Point a,double r)
{
    Point b=a-base;
    a.x=b.x*cos(r)-b.y*sin(r);
    a.y=b.x*sin(r)+b.y*cos(r);
    a=a+base;
    return a;
}
pair<Point,Point>getTangent(Circle c,Point p)
{
    Vector v=p-c.c;
    double r=acos(c.r/v.abs());
    v=v*c.r/v.abs();
    Point p1=rotate(c.c,c.c+v,r);
    Point p2=rotate(c.c,c.c+v,-r);
    return make_pair(p1,p2);
}
int main()
{
    Point p;
    double x,y,r;
    cin>>p.x>>p.y>>x>>y>>r;
    Circle c(Point(x,y),r);
    pair<Point,Point>ans=getTangent(c,p);
    if(ans.second<ans.first)swap(ans.first,ans.second);
    printf("%.10f %.10f\n%.10f %.10f\n",ans.first.x,ans.first.y,ans.second.x,ans.second.y);
    return 0;
}



Measured memory_bytes: 3524
'use strict'

const main = input => {
	const args = input.trim().split('\n')
	const n = parseInt(args[0], 10)
	const h = args[1].split(' ').map(Number)
	const dp = new Array(n)

	for (let i = 0; i < n; i++) {
		dp[i] = Infinity
	}

	dp[0] = 0

	for (let i = 1; i < n; i++) {
		dp[i] = Math.min(dp[i], dp[i - 1] + Math.abs(h[i] - h[i - 1]))
		if (i > 1) dp[i] = Math.min(dp[i], dp[i - 2] + Math.abs(h[i] - h[i - 2]))
	}

	console.log(dp[n - 1])
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


Measured memory_bytes: 27692
#include<iostream>
#include<math.h>

using namespace std;

int main(void) {
	int src = 100;
	int a;
	cin >> a;
	
	for(int i=0; i<a; i++) {
		src = ceil(src*1.05);
	}
	
	cout << src * 1000 << endl;
	
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
bool b[100001];
int i,j,k,n,m,a[100001],x,y;
int main()
{
	cin>>n>>m;
	b[1]=true;
	for(i=1;i<=n;i++)a[i]=1;
	for(i=1;i<=m;i++)
	{
		scanf("%d%d",&x,&y);
		if(b[x])b[y]=true;
		a[x]--;
		if(a[x]==0)b[x]=false;
		a[y]++;
	}
	for(i=1;i<=n;i++)
	if(a[i]&&b[i])k++;
	cout<<k<<endl;
}

Measured memory_bytes: 768
#include<iostream>
#include<iomanip>
#include<climits>
#include<vector>
#include<list>
#include<functional>
#include<algorithm>
#include<string>
#include<cmath>
#include<complex>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;



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

	int N;
	cin >> N;
	vector<int> A(N);
	REP(i, N) cin >> A[i];

	double res = 0;
	REP(i, N) res += 1.0 / A[i];
	res = 1 / res;
	cout << fixed << setprecision(10) << res << endl;

	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

#define MAX_LEN 101
int m[MAX_LEN][MAX_LEN] = {0};

int main(void) {
	int n;
	int i, j, col, num, con;

	scanf("%d", &n);

	for (i = 0; i < n; ++i) {
		scanf("%d", &col);
		scanf("%d", &num);
		for (j = 0; j < num; ++j) {
			scanf("%d", &con);
			m[col][con] = 1;
		}
	}
	for (i = 1; i <= n; ++i) {
		for (j = 1; j <= n; ++j) {
			if (j != n) {
				printf("%d ", m[i][j]);
			} else {
				printf("%d\n", m[i][j]);
			}
		}
	}
	
	return 0;
}

Measured memory_bytes: 636