akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1)
#define IOS ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
#define ff first
#define ss second
#define pb push_back
#define debug(val) cerr << "The value of " << #val << " is = " << val << '\n';
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9 + 7;
const ll inf = 0x3f3f3f3f;
const ll mininf = -922337203685477;
const ll nax = 0;
int n, b[105];
ll sums=0;

int main(){
	IOS
	cin >> n;
	for(int i=1;i<n;i++){
		cin >> b[i];
	}
	for(int i=1;i<=n;i++){
		//cin >> b[i];
		if(i==1){
			sums+=b[i];
		}
		else if(i!=n){
			sums+=min(b[i], b[i-1]);
		}
		else{
			sums+=b[i-1];
		}
	}
	cout << sums << '\n';
}


Measured memory_bytes: 3636
import scala.io.StdIn

object Main extends App {
  val n = StdIn.readLine.toInt
  if((n % 4 == 0) || (n % 7 == 0) || (n % 11 == 0)) println("Yes")
  else {
    val ans = if ((7 until n by 7).exists(i => (n - i) % 4 == 0)) "Yes"
      else "No"
  println(ans)
  }
}

Measured memory_bytes: 27068
j = 0
while j < 10**10:
    h, w = map(int, input().split()) 
    if h == 0 and w == 0:
        break
    j = j + 1
    
    i = 0
    while i < h:
        i = i + 1
        if i == 1 or i == h:
            print('#'*w)
        else:
            print('#' + '.'*(w-2) + '#')
    print()


Measured memory_bytes: 5612
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;


int main() {
	vector<string> substrs;
	int k;
	string s; cin >> s >> k;
	for (int length = 1; length <= k; length++) {
		for (int i = 0; i < s.length() - length + 1; i++) {
			substrs.push_back(s.substr(i, length));
		}
	}
	sort(substrs.begin(), substrs.end());
	unique(substrs.begin(), substrs.end());
	cout << substrs[k - 1] << endl;
	return 0;
}

Measured memory_bytes: 1660
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <set>
#include <queue>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <memory.h>
#include <string>
#include <sstream>
#include <cstdlib>
#include <ctime>
#include <cassert>

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;

#define MP make_pair
#define PB push_back
#define FF first
#define SS second

#define FORN(i, n) for (int i = 0; i <  (int)(n); i++)
#define FOR1(i, n) for (int i = 1; i <= (int)(n); i++)
#define FORD(i, n) for (int i = (int)(n) - 1; i >= 0; i--)

#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define PR0(A,n) { cout << #A << " = "; FORN(_,n) cout << A[_] << ' '; cout << endl; }

// #define FL fflush(stdout)

#define MOD 1000000007
#define INF 2000000000

int GLL(LL& x) {
  return scanf("%lld", &x);
}

int GI(int& x) {
  return scanf("%d", &x);
}

int n, m;
int main() {
  GI(n);
  GI(m);

  if (abs(n - m ) > 1) {
    printf("0\n");
    return 0;
  }

  LL ans = 1;

  FOR1(i, n) {ans *= i; ans %= MOD;}
  FOR1(i, m) {ans *= i; ans %= MOD;}
  if (n == m){
    ans *= 2;
    ans %= MOD;
  }

  printf("%lld\n", ans);
    
  return 0;
}

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

int main(void){
    int X,A,B;
    cin>>X>>A>>B;

    if(A-B>=0)
        cout<<"delicious"<<endl;
    else if(X>=B-A)
        cout<<"safe"<<endl;
    else
        cout<<"dangerous"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){

  int n,a,b,c,d,count;

  while(scanf("%d",&n)!=EOF){
    count=0;
    for(a=0;a<10;a++){
      for(b=0;b<10;b++){
        for(c=0;c<10;c++){
          for(d=0;d<10;d++){
            if(n==(a+b+c+d)){
              count++;
            }
          }
        }
      }
    }
    printf("%d\n",count);
  }
  return 0;
}


Measured memory_bytes: 596
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define int long long
#define INF 1145141919810364364
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first

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

int a, b, c;

signed main() {
	cin >> a >> b >> c;
	cout << min(b / a, c) << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
	long long n,a,b;
	cin>>n>>a>>b;
	if(n>1&&b>=a||n==1&&a==b)
		cout<<(n-2)*(b-a)+1<<endl;
	else cout<<0<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

const int MAXN = 500;

char s[MAXN + 5][MAXN + 5];
int vis[MAXN + 5][MAXN + 5], sum[MAXN + 5];

int main()
{
    int n;
    scanf("%d", &n);
    for(int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
    for(int i = 1; i <= n; i++){
        int len = strlen(s[i] + 1);
        for(int j = 1; j <= len; j++){
            char x = s[i][j];
            vis[i][x]++;
        }
    }
    for(int i = 'a'; i <= 'z'; i++){
        int Min = MAXN;
        for(int j = 1; j <= n; j++) Min = min(Min, vis[j][i]);
        sum[i] = Min;
    }
    string p = "";
    for(int i = 'a'; i <= 'z'; i++){
        for(int j = 1; j <= sum[i]; j++){
            p += i;
        }
    }
    cout<<p<<endl;
}

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

int main() {
    int n, m;
    cin >>n >>m;
    vector<vector<int>> A(n, vector<int> (m, 0));
    vector<int> B(m, 0);
    for (int i=0; i<n; i++)
        for (int j=0; j<m; j++)
            cin >>A.at(i).at(j);
    for (int j=0; j<m; j++)
        cin >>B.at(j);
    for (int i=0; i<n; i++) {
        int S=0;
        for (int j=0; j<m; j++)
            S +=A.at(i).at(j)*B.at(j);
        cout <<S <<endl;
    }
    return 0;
}


Measured memory_bytes: 3172
s = input()
cnt = 0

while True:
  if len(s) < 2:
    break
  if s[0] == s[-1]:
    s = s[1:-1]
  elif s[0] == 'x':
    s += 'x'
    cnt += 1
  elif s[-1] == 'x':
    s = 'x' + s
    cnt += 1
  else:
    print (-1)
    exit()
print (cnt)


Measured memory_bytes: 9272
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
A, B =ri_()
print(max([A + B, A - B, A * B]))

Measured memory_bytes: 63596
package main

import (
	"bufio"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	sc.Scan()
	iv, _ := strconv.Atoi(sc.Text())
	return iv
}

func init() {
	sc.Split(bufio.ScanWords)
}

var graph map[int]map[int]bool

func initGraph(x int) {
	graph = make(map[int]map[int]bool, x)
}

func add(from, to int) {
	if _, ok := graph[from]; !ok {
		graph[from] = make(map[int]bool)
	}
	graph[from][to] = true
}

var (
	cnt []int
	ans []int
)

func dfs(v, pv int) {
	ans[v] = ans[pv] + cnt[v]
	for t := range graph[v] {
		if ans[t] >= 0 {
			continue
		}
		dfs(t, v)
	}
}

func main() {
	n, q := scanInt(), scanInt()
	initGraph(n)
	for i := 0; i < n-1; i++ {
		a, b := scanInt(), scanInt()
		add(a, b)
		add(b, a)
	}

	cnt = make([]int, n+1)
	for i := 0; i < q; i++ {
		p, x := scanInt(), scanInt()
		cnt[p] += x
	}

	ans = make([]int, n+1)
	for i := 1; i <= n; i++ {
		ans[i] = -1
	}

	dfs(1, 0)
	var wr = bufio.NewWriter(os.Stdout)
	for i := 1; i <= n; i++ {
		wr.WriteString(strconv.Itoa(ans[i]))
		if i < n {
			wr.WriteString(" ")
		} else {
			wr.WriteString("\n")
		}
	}
	wr.Flush()
}


Measured memory_bytes: 109312
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main() {
  int N,M;
  cin>>N>>M;
  int L[M],R[M];
  for(int i=0;i<M;i++) cin>>L[i]>>R[i];
  int st=L[0];
  int en=R[0];
  for(int i=0;i<M;i++){
    st=max(st,L[i]);
    en=min(en,R[i]);
  }
  
  if(en-st>=0) cout<<en-st+1<<endl;
  else cout<<"0"<<endl;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep0(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rep1(i,n) for(long long i=1;i<=(long long)(n);i++)
#define all(v) v.begin(),v.end()
#define Sort(v) sort(all(v))
#define Reverse(v) reverse(all(v))
#define Rsort(v) sort(all(v),greater)
#define pub(v) push_back(v)
#define pob(v) pop_back(v)
typedef long long ll;
typedef vector<ll> vel;
typedef vector<vector<ll>> vel2d;
typedef string str;
typedef pair<ll,ll> pal;
typedef vector<str> ves;
typedef vector<char> vech;


int main() {
    ll N; cin>>N;
    ll m=N%10;
    if(m==3){cout<<"bon"<<endl;}
    else if(m==2||m==4||m==5||m==7||m==9){cout<<"hon"<<endl;}
    else if(m==0||m==1||m==6||m==8){cout<<"pon"<<endl;}
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define pp pair<int,int>
#define ll long long
#define ld long double
int inf=100000000;
ll INF=4000000000000000000;
ll MOD=1000000007;



int main() {
   ll a,b;
   cin >> a >> b;
   ll n,m;
   n=max(a,b);
   m=min(a,b);
   if (n-m>1) cout << "Alice" << endl;
   else cout << "Brown" << endl;

  }

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp(a, b) make_pair(a, b)
#define ls (rt << 1)
#define rs (rt << 1 | 1) 
typedef pair<int, int> pii; 
const ll mod = 1e9 + 7;
template <class T> T lowbit(T x){return ((x)&(-(x)));}
const int maxn = 2e5 + 10;
int n, a, b, c, sum;
int f[maxn][3][3];
char path[maxn][3][3];
string s[maxn];
char ans[maxn];
void no() { puts("No"); exit(0);}
void solve1()
{
	string s;
	for(int i = 1; i <= n; ++i)
	{
		cin >> s;
		if(s == "AC")
		{
			if(a <= c) { ++a; --c; ans[i] = 'A';}
			else { ++c; --a; ans[i] = 'C';}
		}
		else if (s == "BC")
		{
			if(b <= c) { ++b; --c; ans[i] = 'B';}
			else { ++c; --b; ans[i] = 'C';}
		}
		else
		{
			if(a <= b) { ++a; --b; ans[i] = 'A';}
			else { ++b; --a; ans[i] = 'B';}
		}
		if(a < 0 || b < 0 || c < 0) no();
	}
	puts("Yes");
	for(int i = 1; i <= n; ++i) printf("%c\n", ans[i]);
}
int dp(int i, int a, int b, bool o = 0)
{
	int c = sum - a - b;
	if(a < 0 || b < 0 || c < 0) return 0;
	else if(i == n + 1) return 1;
	else if(~f[i][a][b]) 
	{
		if(!o) return f[i][a][b];
		else if(f[i][a][b] == 1) printf("%c\n", path[i][a][b]);
	}
	if(s[i] == "AC")
	{
		if(dp(i + 1, a + 1, b, o)) f[i][a][b] = 1, path[i][a][b] = 'A';
		else if(dp(i + 1, a - 1, b, o)) f[i][a][b] = 1, path[i][a][b] = 'C';
		else f[i][a][b] = 0;
	}
	else if(s[i] == "AB")
	{
		if(dp(i + 1, a + 1, b - 1, o)) f[i][a][b] = 1, path[i][a][b] = 'A';
		else if(dp(i + 1, a - 1, b + 1, o)) f[i][a][b] = 1, path[i][a][b] = 'B';
		else f[i][a][b] = 0;
	}
	else
	{
		if(dp(i + 1, a, b + 1, o)) f[i][a][b] = 1, path[i][a][b] = 'B';
		else if(dp(i + 1, a, b - 1, o)) f[i][a][b] = 1, path[i][a][b] = 'C';
		else f[i][a][b] = 0;
	}
	return f[i][a][b];
}
void solve2()
{
	memset(f, -1, sizeof f);
	for(int i = 1; i <= n; ++i) cin >> s[i];
	if(dp(1, a, b, 0))
	{
		puts("Yes");
		dp(1, a, b, 1);
	} 
	else no();
}
int main()
{
	cin >> n >> a >> b >> c;
	sum = a + b + c;
	if(a + b + c >= 3) solve1();
	else solve2();
	return 0;
}
/*
4 1 1 0
AB
BC
BC
AB
*/

Measured memory_bytes: 25708
#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;

	if((a==b && b!=c) || (b==c && c!=a) || (c==a && a!=b)){
		cout<<"Yes";
	}else{
		cout<<"No";
	}
}

Measured memory_bytes: 256
# Author: cr4zjh0bp
# Created: Thu Mar 12 19:59:40 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

N = ni()
D = nin(N)
D.sort()

ans = 1
for i in range(N - 1):
    if D[i] < D[i + 1]:
        ans += 1

print(ans)

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

int main(){
  int N; cin >> N;
  map<string,int> mp_count;
  bool flag = true;
  char check = '.';
  for(int i=0;i<N;i++){
    string temp;
    cin >> temp;
    char start = temp[0];
    if(start != check){
      if(check!='.'){
        flag = false;
        break;
      }
    }
    if(mp_count[temp]>0){
      flag = false;
      break;
    }else{
      mp_count[temp]++;
      check = temp[temp.size()-1];
    }
    
    
  }
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
a, b, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
aa = min(a)
bb = min(b)
aabb = aa+bb
ans = []
ans.append(aabb)
for i in range(m):
    x, y, c = map(int, input().split())
    ans.append(a[x-1]+b[y-1]-c)
print(min(ans))

Measured memory_bytes: 71356
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace PaizaTest
{
    class Program
    {
        static void Main(string[] args)
        {
            var abk = Console.ReadLine().Split(' ').Select(long.Parse).ToList();
            var cookieCountOfTakahashi = abk[0];
            var cookieCountOfAoki = abk[1];

            //var remainderCookieCount = cookieCountOfTakahashi - abk[2];
            if (cookieCountOfTakahashi - abk[2] > 0)
            {
                cookieCountOfTakahashi = cookieCountOfTakahashi - abk[2];
            }
            else
            {
                var remainder = Math.Abs(cookieCountOfTakahashi - abk[2]);
                cookieCountOfTakahashi = 0;
                cookieCountOfAoki = cookieCountOfAoki - remainder < 0 ? 0 : cookieCountOfAoki - remainder;
            }

            Console.WriteLine($"{cookieCountOfTakahashi} {cookieCountOfAoki}");
        }
        
    }
}



Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
#define endl              "\n"
#define pb              push_back
#define fir               first
#define sec               second
#define all(v)            ((v).begin()), ((v).end())
#define sz(v)            ((int)((v).size()))
#define ll              long long
#define ld              long double
#define lp(i, n)        for(int i = 0 ; (int)i<n ; i++)
#define loop(i, x, n)       for(int i=x ; (int)i<=n ; i++)
#define isPowerOfTwo(s) (!(s & (s-1)))
typedef vector<int> vi;
typedef deque<int> de;
void origi() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
}
//int gcd(int a, int b) {
//    if (a == 0) return b;
//    if (b == 0) return a;
//    if (a == b) return a;
//    if (a > b) return gcd(b, a - b);
//    return gcd(a, a - b);
//}
int x[9], y[9];
double distance(int i, int r) {
    int xx = pow(x[i] - x[r],2);
    int yy = pow(y[i] - y[r], 2);
    return sqrt(xx + yy);
}
//int bs(int str, int end) {
//    int ret = -1;
//    while (str <= end) {
//        int mid = (str + end) / 2;
//        if (!(x % mid) && !(y % mid)) {
//            ret = mid;
//            end = mid - 1;
//        }
//        else str = mid + 1;
//    }
//    return ret;
//}
void tiranga() {
    int n;
    cin >> n;
    double res = 0;
    lp(i, n) cin >> x[i] >> y[i];
    lp(i, n) {
        loop(r, i + 1, n - 1)
            res += distance(i, r)*2/n;
    }
    cout <<  fixed << setprecision(10) << res;
}
int main() {
#ifndef ONLINE_JUDGE.
    //freopen("input.txt", "r", stdin);
#else
#endif
    
    origi();
    tiranga();
    //cout << sumOfDig(123654);
   // genLarge(10, 10);
   // genSmall(10);

}


Measured memory_bytes: 256
N, M, X, Y = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.sort(reverse=True)
y.sort()
b = False
if(x[0] < y[0]):
  for z in range(X+1, Y+1):
    if z in range(x[0]+1, y[0]+1):
      b = True
      break
if(b):
  print("No War")
else:
  print("War")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 2100100100;
// const int MOD = 1e9 + 7;

int main() {
    ll X;
    cin >> X;
    cout << X / 500 * 1000 + (X % 500) / 5 * 5 << endl;
}


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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()
#define endl "\n"

using ll = long long;
using P = pair<int,int>;
using mp =  map<string,int>;

const int MOD = 1e9 + 7;
const int INF = 1001001001;


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

    vector<ll> a(3);
    cin >> a[0] >> a[1] >> a[2];
    sort(all(a));

    if(a[2] % 2 == 0){
        cout << 0 << endl;
    }else{
        cout << a[0] * a[1] << endl;
    }


    return 0;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		var result string
		line := scanner.Text()
		key := make(map[string]string)

		var i int32
		for ; i < 52; i++ {
			makeKey(key, i)
			result = decode(key, line)

			if strings.Contains(result, "the") {
				break
			} else if strings.Contains(result, "this") {
				break
			} else if strings.Contains(result, "that") {
				break
			}
		}

		fmt.Println(result)
	}
}

func makeKey(key map[string]string, shift int32) {
	for i := 'a'; i <= 'z'; i++ {
		cipher := (i + shift)
		if cipher > 'z' {
			cipher = cipher%'z' + 'a' - 1
		} else if cipher < 'a' {
			cipher = cipher + ('z' - 'a') + 1
		}
		key[string(i)] = string(cipher)
	}
}

func decode(key map[string]string, cipher string) string {
	var result string
	for _, v := range cipher {
		if key[string(v)] != "" {
			result += key[string(v)]
		} else {
			result += string(v)
		}
	}
	return result
}



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

using namespace std;

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

int main(){
    int a,b,c,cnt = 0;
    cin >> a>> b>> c;
    for(int i=a;i<=b;i++)if(c%i == 0)cnt++;
    cout << cnt << endl;

    return 0;
}



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

int main()
{
  int a, b, x;
  cin >> a >> b >> x;
  if(x - a <= b && x >= a)
  {
    cout << "YES" << endl;
  }
  else
  {
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 256
def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            return False
    return True

x = int(input())

while True:
    if is_prime(x):
        print(x)
        break
    else:
        x += 1


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

int		main(void)
{
	int		n;
	int		*arr;
	int		i;
	int		sum;
	int		sum2;
	int		p;

	if (!(scanf("%d", &n)))
		return (-1);
	if (!(arr = (int *)malloc(n * sizeof(int))))
		return (-1);
	i = 0;
	while (i < n)
		if (!(scanf("%d", &arr[i++])))
			return (-1);
	sum = 0;
	i = 0;
	while (i < n)
		sum += arr[i++];
		p = sum / n;
	sum = 0;
	i = 0;
	while (i < n)
	{
		sum += (arr[i] - p) * (arr[i] - p);
		i++;
	}
	p++;
	sum2 = 0;
	i = 0;
	while (i < n)
	{
		sum2 += (arr[i] - p) * (arr[i] - p);
		i++;
	}
	if (sum2 < sum)
		sum = sum2;
	printf("%d", sum);
}


Measured memory_bytes: 128
/**
*    author:  yuya1234
*    created: 14.07.2020 15:04:10
**/

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define FORV(i,v) for(auto i=v.begin(); i!=v.end();i++)

#define SORT(s) sort((s).begin(),(s).end())
#define SORTD(s) sort((s).rbegin(),(s).rend())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define SZ(x) ((int)(x).size())
#define MEMSET(v, h) memset((v), h, sizeof(v))

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; }
template<class T>T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<class T>T lcm(T a,T b){return gcd(a,b)*(a/gcd(a,b))*(b/gcd(a,b));}

int main() {
  long double a,b,c;
  cin>>a>>b>>c;

  long double eps = 1.0E-14;

  if(sqrt(a)+sqrt(b)+eps<sqrt(c))cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

  return 0;
}

Measured memory_bytes: 3748
#include <bits/stdc++.h>
                                        #include<iostream>
                                        #include<cstdio>
                                        #include<vector>
                                        #include<queue>
                                        #include<map>
                                        #include<cstring>
                                        #include<string>
                                        #include <math.h>
                                        #include<algorithm>
                                    //    #include <boost/multiprecision/cpp_int.hpp>
                                        #include<functional>
                                #define int long long
                                        #define inf  1000000007
                                        #define pa pair<int,int>
                                        #define ll long long
                                        #define pal pair<double,pa>
                                        #define ppa pair<int,int>
                                        #define ppap pair<pa,pa>
                                        #define ssa pair<string,int>
                                        #define  mp make_pair
                                        #define  pb push_back
                                        #define EPS (1e-10)
                                        #define equals(a,b) (fabs((a)-(b))<EPS)
                                  #define VI vector<int>
                                        using namespace std;


int gcd(int a,int b){
	if(a<b) return gcd(b,a);
	if(b==0) return a;
	if(a%b==0) return b;
	return gcd(b,a%b);
}
int a[1000];

            signed main(){
            	int n;
   cin>>n;
            	for(int i=0;i<n;i++)cin>>a[i];
            	int g=a[0];
            	for(int i=1;i<n;i++){
            		int gg=gcd(g,a[i]);
            		g/=gg;
            		g*=a[i];
            	}
            	cout<<g<<endl;
            	
            }
             

Measured memory_bytes: 3100
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
list=[a,b,c,d,e]
worst=10
flag=0
ans=0
for i in range(5):
  if list[i]%10 != 0:
    if list[i]%10 < worst:
      worst = list[i]%10
      flag=i
for i in range(5):
  if i == flag:
    ans += list[i]
  elif list[i]%10 == 0:
    ans += list[i]
  else:
    ans += (list[i] + 10-list[i]%10)
print(ans)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
int main() {
    string s;
    cin >> s;
    int flag = 0;
    for (int i = 0; i < s.length() - 1; ++i) {
        if (s[i] == s[i + 1])
            flag = 1;
    }
    if (flag == 1)
        cout << "Bad";
    else
        cout << "Good";
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <string>
#include <random>
#include <stack>
#include <set>
#include <unordered_set>

#define bug(x) cout<<"zdongdebug: "<<x<<endl;
#define bug2(x, y) cout<<"zdongdebug: "<<x<<" "<<y<<endl;
using namespace std;
typedef unsigned long long ll;
const int maxn = 105;

int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  //freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  int n,m;
  cin>>n>>m;
  if(m>(n-1)*(n-2)/2){
    cout<<-1<<endl;
    return 0;
  }
  vector<pair<int,int>>ans;
  for(int i=2;i<=n;i++)ans.push_back(make_pair(1, i));
  int cur = (n-1)*(n-2)/2;
  for(int i=2;i<=n;i++)
    for(int j=i+1;j<=n;j++){
      if(cur==m)break;
      ans.push_back(make_pair(i,j));
      cur--;
    }
  cout<<ans.size()<<endl;
  for(int i=0;i<ans.size();i++){
    cout<<ans[i].first<<" "<<ans[i].second<<endl;
  }
  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX = (1e5)+1;
 int n;
vector<pair<ll, ll> > a;
multiset<ll> r, b;
long long ans = LLONG_MAX;
int main() {	
ios::sync_with_stdio(false);
cin.tie(0);	
cin >> n;
a.resize(n);	
for(int i = 0; i < n; i++) {	
	cin >> a[i].first >> a[i].second;		if(a[i].first > a[i].second) 
swap(a[i].first, a[i].second);
	}	
sort(a.begin(), a.end());
	for(auto p: a) {	
	r.insert(p.first);	
	b.insert(p.second);	}	
ans = min((*r.rbegin() - *r.begin()) * (*b.rbegin() - *b.begin()), ans);	
for(auto p: a) {	
	r.erase(r.find(p.first));		b.erase(b.find(p.second));		r.insert(p.second);	
	b.insert(p.first);	
	ans = min((*r.rbegin() - *r.begin()) * (*b.rbegin() - *b.begin()), ans);	}
	cout << ans;}

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

int main()
{
    int x[5];
    for(int i=0;i<5;i++)
    {
        cin>>x[i];
    }
    for(int i=0;i<5;i++)
    {
        if(x[i]!=i+1)
        {
            cout<<i+1<<"\n";
        }
    }
}


Measured memory_bytes: 3544
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* WRITER:kakitamasziru/OxOmisosiru *$*
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include <limits>//setprecision
//#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
//#include <unordered_set> //unordered_set
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
#include <bitset> // bitset
#define endl "\n";
//It is so troublesome that I include bits/stdc++.h !
using namespace std;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
const long long INF = 100100100100100;
const long long MOD = 1000000007;
typedef pair<int,int> P;

//Solve N^M. This, mod_pow use Iterative Square Method.
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //最下位ビット(*N)が1の時は単独でNをかける
    if (M & 1) res = (res * N) % MOD;

    return res %= MOD;
}

int gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
    return a / gcd(a, b) * b ;
}



int main() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    int L,R;cin >> L >> R;
    int D;cin >> D;
    int ans = 0;
    for(int i = L;i<=R;i++){
        if(i % D == 0) ans++;
    }
    cout << ans << endl;

}


Measured memory_bytes: 3608
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

n,k=MI()
hs=LI()
dp=[inf for i in range(n)]
dp[0]=hs[0]

for i in range(min(n,k)):
    dp[i]=abs(hs[i]-hs[0])
for i in range(n):
    mn=dp[i]
    for j in range(1,k+1):
        if i-j>=0:
            u=dp[i-j]+abs(hs[i]-hs[i-j])
            if u<mn:
                mn=u
    dp[i]=mn
print(dp[-1])


Measured memory_bytes: 56024
#include <iostream>
#include <vector>
#include <utility>
#include <numeric>
#include <functional>
#include <stdio.h>
#include <math.h>
#include <string>
#include <algorithm>
#include <deque>
#include <queue>
#include <map>

#define rep(i, m, n) for (int (i)(m); (i)<(n); ++(i))
#define repr(i, m, n) for (int (i)(m - 1); (i)>=(n); --(i))
#define repv(i, v) for (unsigned (i)(0); (i)<(v.size()); ++(i))
#define all(v) (v).begin(), (v).end()
#define sortv(v) sort(all(v))
#define sortgi(v) sort(all(v), greater<int>())
#define sortgd(v) sort(all(v), greater<double>())
#define sortgll(v) sort(all(v), greater<ll>())
#define debug(x) cerr << #x << ": " << x << '\n'

using namespace std;
using pii = pair<int, int>;
using pss = pair<string, string>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using ll = long long;
using pllll = pair<ll, ll>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vpii = vector<pii>;
using pqi = priority_queue<int>;
using pqd = priority_queue<double>;
using pqll = priority_queue<ll>;
using pqvi = priority_queue<vi>;
using pqvll = priority_queue<vll>;

template<class T>
void accum(vector<vector<T> > &v) {
	for (signed i(1); i < v.size(); ++i) {
		for (signed j(1); j < v[0].size(); ++j) {
			v[i][j] = v[i][j] + v[i][j - 1];
		}
	}
	for (signed i(1); i < v.size(); ++i) {
		for (signed j(1); j < v[0].size(); ++j) {
			v[j][i] = v[j][i] + v[j - 1][i];
		}
	}
}


int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
	int N, M, Q;
	cin >> N >> M >> Q;
	vvi lr(N + 1, vi(N + 1, 0)); 
	rep(i, 0, M) {
		int l, r;
		cin >> l >> r;
		++lr[l][r];
	}
	accum(lr);
	rep(i, 0, Q) {
		int p, q;
		cin >> p >> q;
		cout << lr[q][q] - lr[p-1][q] - lr[q][p-1] + lr[p-1][p-1] << endl;
	}
}

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

int main() {
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  if(a == 0)
    cout << 1 << endl;
  if(b == 0)
    cout << 2 << endl;
  if(c == 0)
    cout << 3 << endl;
  if(d == 0)
    cout << 4 << endl;
  if(e == 0)
    cout << 5 << endl;
  return 0;
}


Measured memory_bytes: 3596
fun main(args: Array<String>) {
    val (n, k) = readLine()!!.split(' ').map(String::toInt)
    val tdList = (1..n).map { readLine()!!.split(' ').map(String::toLong).let { Pair(it[0], it[1]) } }.sortedByDescending { it.second }

    val selected = tdList.take(k).sortedByDescending { it.second }//美味しさだけで選ばれたk個の寿司
    val notSelected = tdList.takeLast(n - k).sortedByDescending { it.second }//選ばれなかった寿司
    val ds = selected.map { it.first }.toSet()//選択されたネタの一覧
    //選ばれた寿司の中で、ネタが重複しているもののうち、スコアが低い方のリストを作成する
    val changeableSelected = mutableListOf<Pair<Long, Long>>()
    run {
        val tempD = mutableSetOf<Long>()
        for (s in selected) {
            if (tempD.contains(s.first)) {
                changeableSelected.add(s)
            } else {
                tempD.add(s.first)
            }
        }
    }

    //選ばれなかった寿司の中で、選んだすしに含まれないもののうち、スコアが高い方のリストを作成する
    val changeableNotSelected = mutableListOf<Pair<Long, Long>>()
    run {
        val tempD = mutableSetOf<Long>()
        for (ns in notSelected) {
            if (tempD.contains(ns.first).not() && ds.contains(ns.first).not()) {
                changeableNotSelected.add(ns)
                tempD.add(ns.first)
            }
        }
    }

    //選んだ寿司の中でネタが重複しているもののうち、スコアが小さいものから1つ消し、選ばなかったものから1つ追加する、という処理を実行できなくなるまで繰り返し、その中で最大の満足度を探す
    var dc = ds.count().toLong()//ネタの種類数
    var maxScore = selected.map { it.second }.sum() + dc * dc//暫定最大満足ポイント
    var tempMax = maxScore
    while (changeableSelected.size > 0 && changeableNotSelected.size > 0) {
        tempMax = tempMax - changeableSelected.last().second + changeableNotSelected.first().second - dc * dc + (dc + 1) * (dc + 1)
        dc++
        changeableSelected.removeAt(changeableSelected.size - 1)
        changeableNotSelected.removeAt(0)
        maxScore = Math.max(maxScore, tempMax)
    }
    println(maxScore)
}


Measured memory_bytes: 90136
/*
ID: anonymo14
TASK: wormhole
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int,int>> vpii;

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

#define REP(i,a,b) for(int i=a; i<=b; i++)

#define MOD 1000000007

void solve(int test_case) {//211
	string a,b,c;
	cin>>a>>b>>c;
	a=a[0]-'a'+'A';
	a+=(b[0]-'a'+'A');
	a+=(c[0]-'a'+'A');
	cout<<a;
}

int main() {
	
	////// FILE BASED IO////
	//freopen("wormhole.in", "r", stdin);
	//freopen("wormhole.out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
	return 0;
}	


Measured memory_bytes: 3632
#n=int(input())
a,b=map(str,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
n=int(a+b)
flag='No'
for i in range(1,n+1):
    if i*i==n:
        flag='Yes'
print(flag)

Measured memory_bytes: 9088
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
#define all(v) (v).begin(), (v).end()
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

const int MAX_V = 1e5;
vector<int> G[MAX_V];
int N, M;
int color[MAX_V];

bool dfs(int v, int c) {
	color[v] = c;
	rep(i, 0, G[v].size()) {
		if(color[G[v][i]] == c) return false;
		if(color[G[v][i]] == 0 and !dfs(G[v][i], -c)) return false;
	}
	return true;
}


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

	cin >> N >> M;
	rep(i, 0, M) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}

	rep(i, 0, N) {
		if(color[i] == 0) {
			if(!dfs(i, 1)) {
				/* 二部グラフではない */
				cout << 1LL * N * (N - 1) / 2 - M << endl;
				return 0;
			}
		}
	}

	ll red = 0, blue = 0;
	rep(i, 0, N) {
		if(color[i] == 1) red++;
		else blue++;
	}

	cout << 1LL * red * blue - M << endl;
	return 0;


	

}


Measured memory_bytes: 6528
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i++)
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; }
const long long INF = 1LL << 60;
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

vector<int> g[100010];

int main()
{
  int n, m; cin >> n >> m;
  rep(i, m)
  {
    int s, t;
    cin >> s >> t;
    --s;--t;
    g[s].push_back(t);
    g[t].push_back(s);
  }
  queue<int> q;
  vector<int> dist(n, MOD);
  vector<int> pre(n, -1);
  dist[0] = 0;
  q.push(0);
  
  while(!q.empty())
  {
    int v = q.front(); q.pop();
    for (int u : g[v])
    {
      if (dist[u] != MOD) continue;
      dist[u] = dist[v] + 1;
      pre[u] = v;
      q.push(u);
    }
  }
  
  cout << "Yes" << endl;
  rep(i, n)
  {
    if (i == 0) continue;
    int ans = pre[i];
    ++ans;
    cout << ans << endl;
  }
}

Measured memory_bytes: 10644
def main():
    k = int(input())
    amari = 7
    ans = 0

    while ans <= k:
        amari = amari % k
        ans += 1
        if amari == 0:
            print(ans)
            exit()
        else:
            amari = amari * 10 + 7
            #print(amari, ans)
    print(-1)


if __name__ == "__main__":
    main()

Measured memory_bytes: 62848
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  while n % (p ** e) == 0:
    n //= (p ** e)
    score += 1
    e += 1
  else:
    while n % p == 0:
      n //= p
    p += 2 - (p == 2)
else:
  score += (n > 1)
print(score)

Measured memory_bytes: 9204
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define FORR(I,A,B) for(ll I = ((B)-1); I >= (A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=1e18+7;
const ll MOD=1e9+7;
#define pri(a) cout << (a) << endl
vector< vector<ll> > paz;
vector< vector<ll> > pazp;
ll score,N;
void pazdrop(){
	pazp = paz;
	paz = vector<vector<ll>>(N,vector<ll>(5, 0));
	FOR(i,0,5){
		ll k = N-1;
		FORR(j,0,N){
			if(pazp[j][i]!=0){
				paz[k][i] = pazp[j][i];
				k--;
			}
		}
	}
}
bool pazclear(){
	bool c = false;
	FOR(i,0,N){
		ll n = paz[i][0];
		ll k = 0;
		FOR(j,0,5){
			if(paz[i][j]==n){
				k++;
			}else{
				if(k>2&&n!=0){
					c = true;
					FOR(l,1,k+1){
						score+=paz[i][j-l];
						paz[i][j-l]=0;
					}	
				}
				k = 1;
				n = paz[i][j];
			}
		}
		if(k>2&&n!=0){
			c = true;
			FOR(l,1,k+1){
				score+=paz[i][5-l];
				paz[i][5-l]=0;
			}
		}
	}
	if(c)pazdrop();
	return c;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	while(cin>>N){
		if(N==0)break;
		score = 0;
		paz =  vector< vector<ll> >(N,vector<ll>(5, 0));
		FOR(i,0,N){
			FOR(j,0,5){
				cin >> paz[i][j];
			}
		}
		while(pazclear());
		cout << score << endl;
	}
}


Measured memory_bytes: 3088
Taro = int(input())
Jiro = int(input())
Sabu = int(input())
Siro = int(input())
Hana = int(input())

list1 = []
list1.append(Taro)
list1.append(Jiro)
list1.append(Sabu)
list1.append(Siro)
list1.append(Hana)

list2 = []
for i in range(5):
    if list1[i]>=40:
        list2.append(list1[i])
    
    if list1[i]<40 :
        list2.append(40)

ave = sum(list2)/5
print(int(ave))


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

int main() {
	int A, B, C, X, count = 0;
	cin >> A >> B >> C >> X;
	for (int i = 0; i <= A; i++) {
		for (int j = 0; j <= B; j++) {
			int n = (X - 500 * i - 100 * j) / 50;
			if (0 <= n && n <= C) count++;
		}
	}
	cout << count << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<ctime>
#include<utility>
#include<cmath>
#include<functional>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
void sort(int &a,int &b)
{
	if(a>b)
		swap(a,b);
}
void open(const char *s)
{
#ifndef ONLINE_JUDGE
	char str[100];
	sprintf(str,"%s.in",s);
	freopen(str,"r",stdin);
	sprintf(str,"%s.out",s);
	freopen(str,"w",stdout);
#endif
}
int rd()
{
	int s=0,c;
	while((c=getchar())<'0'||c>'9');
	do
	{
		s=s*10+c-'0';
	}
	while((c=getchar())>='0'&&c<='9');
	return s;
}
int upmin(int &a,int b)
{
	if(b<a)
	{
		a=b;
		return 1;
	}
	return 0;
}
int upmax(int &a,int b)
{
	if(b>a)
	{
		a=b;
		return 1;
	}
	return 0;
}
int f[3010][3010][2];
const int p=1000000007;
void add(int &a,int b)
{
	a=(a+b)%p;
}
int main()
{
	int n,m;
	scanf("%d%d",&n,&m);
	int i,j,k;
	f[0][0][1]=1;
	for(i=1;i<=n;i++)	
		f[0][i][0]=1;
	for(i=0;i<m;i++)
		for(j=0;j<=n;j++)
			for(k=0;k<=1;k++)
				if(f[i][j][k])
				{
					if(j)
					{
						add(f[i+1][j][k|(j==1)],f[i][j][k]);
						add(f[i+1][j-1][k|(j==1)],f[i][j][k]);
					}
					if(n-j)
					{
						add(f[i+1][j][k],f[i][j][k]);
						add(f[i+1][j+1][k],f[i][j][k]);
					}
				}
	int ans=0;
	for(i=0;i<=n;i++)
		add(ans,f[m][i][1]);
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 70784
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func getNextLine(scanner *bufio.Reader) string {
	var buffer string
	for {
		line, isPrefix, _ := scanner.ReadLine()
		buffer += string(line)
		if isPrefix == false {
			break
		}
	}
	return buffer
}

func getIntList(scanner *bufio.Reader) []int {
	list := strings.Split(getNextLine(scanner), " ")
	l := len(list)
	result := make([]int, l)
	for i := 0; i < l; i++ {
		result[i], _ = strconv.Atoi(list[i])
	}
	return result
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := bufio.NewReader(fp)
	writer := bufio.NewWriter(os.Stdout)

	var n int
	fmt.Sscan(getNextLine(scanner), &n)
	empty := List{
		x: -1,
	}
	empty.prev = &empty
	empty.next = &empty
	for i := 0; i < n; i++ {
		s := getNextLine(scanner)
		order := strings.Split(s, " ")
		switch order[0] {
		case "insert":
			x, _ := strconv.Atoi(order[1])
			newOne := List{
				x:    x,
				prev: &empty,
				next: empty.next,
			}
			empty.next.prev = &newOne
			empty.next = &newOne
		case "delete":
			x, _ := strconv.Atoi(order[1])
			for l := empty.next; l != &empty; l = l.next {
				if l.x == x {
					l.prev.next = l.next
					l.next.prev = l.prev
					break
				}
			}
		case "deleteFirst":
			l := empty.next
			if l != &empty {
				l.prev.next = l.next
				l.next.prev = l.prev
			}
		case "deleteLast":
			l := empty.prev
			if empty.prev != &empty {
				l.prev.next = l.next
				l.next.prev = l.prev
			}
		}

	}
	for l := empty.next; l != &empty; l = l.next {
		fmt.Fprint(writer, l.x)
		if l.next != &empty {
			fmt.Fprint(writer, " ")
		}
	}
	fmt.Fprintln(writer, "")

	writer.Flush()
}

type List struct {
	x    int
	prev *List
	next *List
}



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

int main() {
    int64_t X, Y, A, B, C;
    std::cin >> X >> Y >> A >> B >> C;

    int64_t p[A];
    int64_t q[B];
    int64_t r[C];
    for (int64_t i = 0; i < A; ++i) {
        std::cin >> p[i];
    }

    for (int64_t i = 0; i < B; ++i) {
        std::cin >> q[i];
    }
    
    for (int64_t i = 0; i < C; ++i) {
        std::cin >> r[i];
    }

    std::sort(p, p + A, std::greater<int64_t>()); 
    std::sort(q, q + B, std::greater<int64_t>()); 
    std::sort(r, r + C, std::greater<int64_t>()); 

    std::vector<int64_t> ans;
    ans.reserve(X + Y);
    for (int64_t i = 0; i < X; ++i) {
        ans.push_back(p[i]);
    }

    for (int64_t i = 0; i < Y; ++i) {
        ans.push_back(q[i]);
    }

    std::sort(ans.begin(), ans.end(), std::greater<int64_t>());

    int64_t sum = 0;  
    int64_t pos1 = 0, pos2 = 0, cnt = 0;
    while (cnt < (X + Y)) {
        if (pos2 < C && ans[pos1] < r[pos2]) {
            sum += r[pos2];
            ++pos2;
        } else {
            sum += ans[pos1];
            ++pos1;
        }

        ++cnt;
    }

    std::cout << sum << std::endl;

    return 0;
}


Measured memory_bytes: 3968
#include <iostream>

#define NMAX 100

void bubbleSort(int A[], int N) {
    bool flag = 1;
    int temp;
    int cnt = 0;
    while(flag) {
        flag = 0;
        for (int j=N-1; j>0; j--) {
            if (A[j] < A[j-1]) {
                temp = A[j];
                A[j] = A[j-1];
                A[j-1] = temp;
                flag = 1;
                cnt++;
            }
        }
    }
    for (int i=0; i<N-1; i++)
        std::cout << A[i] << " ";
    std::cout << A[N-1] << std::endl;
    std::cout << cnt << std::endl;

}

int main() {
    int A[NMAX] = {};
    int N;
    
    std::cin >> N;
    
    for (int i=0; i<N; i++)
        std::cin >> A[i];
    
    bubbleSort(A, N);
    
    return 0;   
}


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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

const int N = 3e3+23;
const int mod = 998244353;

long long dp[N][N];
int a[N];

void solve() {
  int n, s; scanf("%d%d", &n, &s);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a+i);
  }
  dp[0][0] = 1;
  for (int i = 0; i <= s; ++i) {
    for (int j = 0; j < n; ++j) {
      dp[i][j+1] = (dp[i][j+1] + dp[i][j]*2) %mod;
      if (i+a[j] <= s)
	dp[i+a[j]][j+1] = (dp[i+a[j]][j+1] + dp[i][j]) % mod;
    }
  }
  printf("%lld", dp[s][n]);
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Measured memory_bytes: 74704
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
int N;cin>>N;string s;
  vector<long long>a(N);
  rep(i,N){long long t; cin>>t;a.at(i)=t;}
  sort(a.begin(),a.end());
  rep(i,N-1){if(a.at(i)==a.at(i+1)){s="NO";break;}
            else{s="YES";continue;}}
cout<<s<<endl;  
}

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

int main() {

  int D,G;
  cin >> D >> G;
  vector<vector<int>> q( D, vector<int>(2));
  for (int i=0; i<D; i++) {
    int p,c;
    cin >> p >> c;
    q.at(i) = { p, (i+1) * p * 100 + c };
  }
    
  vector<int> A;
  for (int tmp = 0; tmp < (1 << 11); tmp++) {
    bitset<11> s(tmp);
    if( s.test(D) ) break;
    
    int a=0,b=0;
    for (int i=0; i<D; i++){
      if (s.test(i)) {
        a += q.at(i).at(0);
        b += q.at(i).at(1);
      }
    }
    if (b < G) {
      for (int i=D-1; i>=0; i--){
        if ( !s.test(i) ) {
          for (int j=1; j<q.at(i).at(0); j++){
            a++;
            b += (i+1)*100;
            if ( G <= b) break;
          }
          if( G > b){
            a = 0;
            b = 0;
          }
          if ( G <= b || G > b) break;
        }
      }
    }
    if( a > 0 ) A.push_back(a);
  }
  sort(A.begin(), A.end());
  cout << A.at(0) << endl;
}

Measured memory_bytes: 256