akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define scd(t) scanf("%d",&t)
#define scld(t) scanf("%ld",&t)
#define sclld(t) scanf("%lld",&t)
#define scc(t) scanf("%c",&t)
#define scs(t) scanf("%s",t)
#define scf(t) scanf("%f",&t)
#define sclf(t) scanf("%lf",&t)
#define MEM(a, b) memset(a, (b), sizeof(a))
#define ffor(i, j, k, in) for (int i=j ; i<k ; i+=in)
#define rfor(i, j, k, in) for (int i=j ; i>=k ; i-=in)
#define rep(i, j) ffor(i, 0, j, 1)
#define rrep(i, j) rfor(i, j, 0, 1)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define IN(A, B, C) assert( B <= A && A <= C)
#define mp make_pair
#define pb push_back
//#define f first
//#define s second
#define inf (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
#define read(type) readInt<type>()
#define trace1(x)                     cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define trace5(a, b, c, d, e)        cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<endl;
const double pi=acos(-1.0);
typedef pair<long long int,long long int> pii;
typedef long long ll;
typedef vector<long long int> vi;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
typedef map<long long int,long long int> mpii;
typedef set<long long int> sei;
typedef multiset<long long int> msei;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int  uint64;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    ll i,j,n,m,k;
    cin>>n>>k;
    ll a[n+1];
    for(i=1;i<=n;i++)
    cin>>a[i];
    ll dp[n+1]={0};
    for(i=1;i<=n;i++)
    {
        if(i==1)
        dp[i]=0;
        else
        dp[i]=1000000000000;
        for(j=i-1;j>=1 && i-j<=k;j--)
        {
            dp[i]=min(dp[i],dp[j]+abs(a[i]-a[j]));
        }
    }
    cout<<dp[n];
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define rep(i,n)    for(long long i = 0; i < (n) ; ++i)
#define orep(i,n)   for(long long i = 1; i <= (n); ++i)   // one rep
#define drep(i,n)   for(long long i = (n)-1; i >= 0; --i) // down rep
#define srep(i,s,t) for(long long i = (s); i < (t); ++i)  // set rep
#define rng(x)  (x).begin(),(x).end()

  // range
#define rrng(a) (a).rbegin(),(a).rend() // reverse range
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define ru(x,y) (((x)+(y)-1)/(y)) // round up
#define fi first
#define se second
#define eb emplace_back
#define fcout cout << fixed << setprecision(15)


using namespace std;
using ll  = long long;
using P   = pair<int,int>;
using vi  = vector<int>;
using vvi = vector<vi>;
using vp  = vector<P>;
using vl  = vector<ll>;

template<typename T> void Yes(T flag) {
  cout << (flag ? "Yes" : "No") << endl;
}

template<typename T> void pv(vector<T> vec) {
  cout << "[";
  for(auto& v : vec) { cout << v << ","; }
  cout << "]" << endl;
}

template<>
void pv(vector<P> vec) {
  cout << "[";
  for(auto& v : vec) {
    cout << "<" << v.fi << ","<< v.se << ">" << ",";
  }
  cout << "]" << endl;
}

template<typename T> void pv2(vector<vector<T>> vec) {
  for(auto& v : vec) pv(v);
}

int main() {
  ll n,k;
  cin >> n >> k;
  vp a(n+1,P(0,0));
  rep(i,n) {
    int b;
    cin >> b;
    a.at(i+1) = P(b,0);
  }
  ll loop=0;
  int here = 1;
  a.at(1).se = 1;
  rep(i,n) {
    here = a.at(here).fi;
    k--;
    if(k==0) {
      cout << here << endl;
      return 0;
    }
    if(a.at(here).se) break;
    a.at(here).se=1;
  }
  rep(i,n+1) a.at(i).se=0;
  a.at(here).se=1;
  rep(i,n) {
    here = a.at(here).fi;
    loop++;
    if(a.at(here).se) break;
  }
  rep(i,k%loop) {
    here = a.at(here).fi;
  }
  cout << here << endl;




  return 0;
}


Measured memory_bytes: 4844
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i,n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<"\n"
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define mp make_pair
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using vc = vector<char>;
using vvc = vector<vc>;
template<class T> inline bool chmax(T& a, T b) { 
 if (a < b) { a = b; return true; } return false; 
}
template<class T> inline bool chmin(T& a, T b) {
 if (a > b) { a = b; return true; } return false; 
}
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n;
  cin>>n;
  if(n>=30)COUT("Yes");
  else COUT("No");
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++) 
#define inf 10000000000000;
typedef long long ll;




int main(){

    int n;
    cin >> n;

    int max;

    int a[n+5];
    int b[n+5];

    rep(i,n){
        cin >>a[i];
        b[i]=a[i];
    }

    sort(b,b+n);

    rep(i,n){
        if(a[i]==b[n-1]){
            max=b[n-2];
        }
        else{
            max=b[n-1];
        }

        cout << max << endl;
    }


    return 0;
}

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

typedef long long ll;
typedef long double ld;
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353
#define Graph vector<vector<int>>

int main() {
    int N; cin >> N;
    vector<int> A(N);
    A.push_back(0);
    int sum = 0;
    for (int i = 1; i < N + 1; i++) {
        cin >> A.at(i);
        sum += abs(A.at(i) - A.at(i - 1));
    }
    sum += abs(A.at(N));
    A.push_back(0);
    for (int i = 1; i < N + 1; i++) {
        int disap = abs(A.at(i) - A.at(i - 1)) + abs(A.at(i + 1) - A.at(i));
        int appea = abs(A.at(i + 1) - A.at(i - 1));
        cout << sum - disap + appea << endl;
    }
    return 0;
}

Measured memory_bytes: 4048
#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
template<class T> inline void chmin(T& a, T b) {if (a>b) a=b; }
template<class T> inline void chmax(T& a, T b) {if (a<b) a=b; }
inline void print() { cout << endl; }
template <class Head, class... Tail> inline void print(Head&& head, Tail&&... tail) {cout << head; if (sizeof...(tail) != 0) cout << " "; print(forward<Tail>(tail)...);}
template <class T> inline void print(vector<T>& vec) { for (auto& a : vec) {cout << a; if (&a != &vec.back()) cout << " "; } cout << endl;}
template <class T> inline void print(vector<vector<T>>& df) { for (auto& vec : df) { print(vec); }}
typedef long long ll;
const ll LINF = 1e18;
const int INF = 1e9;

vector<int> H;

int main() {
    int N; cin >> N;
    vector<int> h(N);
    int maxH = 0;
    REP(i, N) {
        cin >> h[i]; chmax(maxH, h[i]);
    }
    vector<vector<int>> m(maxH, vector<int>(N));
    REP(height, maxH) {
        REP(i, N) {
            if (h[i] >= height+1) {
                m[height][i] = 1;
            } else {
                m[height][i] = 0;
            }
        }
    }
    int ct = 0;
    REP(height, maxH) {
        bool reset = true;
        REP(i, N) {
            if (reset && m[height][i] == 1) {
                ct++;
                reset = false;
            } else if(m[height][i] == 0 && !reset) {
                reset = true;
            }
        }
    }
    // print(m);
    cout << ct << endl;


    return 0;

}


Measured memory_bytes: 256
D, N = map(int, input().split())

if D == 1:
    num = [i*100 for i in range(1, N+1)]
    if N == 100:
        num[-1] += 100

elif D == 2:
    num = [i*10000 for i in range(1, N+1)]
    if N == 100:
        num[-1] += 10000

elif D == 0:
    num = [i for i in range(1, N+1)]
    if N == 100:
        num[-1] += 1

print(num[-1])


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  string ans;
  string a, b;
    cin >> a >> b;
    if(a.size()<b.size()){
      ans = "LESS";
    }else if(a.size()>b.size()){
      ans = "GREATER";
    }else{
      (a<=b) ? ((a==b)?ans="EQUAL":ans="LESS") : ans="GREATER";
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
LS=lambda:list(map(str,input().split()))

def main():
    import sys
    input=sys.stdin.readline
    n,q=L()
    s=S().rstrip()
    
    a=[0]*n
    tmp=0
    for i in range(n-1):
        if s[i:i+2]=='AC':
            tmp+=1
        a[i+1]=tmp
    for i in range(q):
        li,ri=L()
        print(a[ri-1]-a[li-1])

if __name__ == '__main__':
    main()

Measured memory_bytes: 6188
#include"bits/stdc++.h"
using namespace std;
#define int long long
#define con continue
#define rep(i,n) for(int i=0;i<n;i++)
const long long mod = 1000000007;
const long long inf = 1ll<<61;
typedef pair<int, int> P;
typedef pair<P, int> PP;
typedef pair<int, PP> PPP;
struct edge { int to; int to2; int cost; };

vector<int>G[200006];
int ae[200006], be[200006];
int used[200006];
signed main() {
	int n, m; cin >> n >> m;
	string s; cin >> s;
	rep(i, m) {
		int a, b; cin >> a >> b;
		a--; b--;
		G[a].push_back(b);
		if (a - b)G[b].push_back(a);
	}
	queue<int>Q;
	rep(i, n) {
		rep(j, G[i].size()) {
			if (s[G[i][j]] == 'A')ae[i]++;
			else be[i]++;
		}
		if (ae[i] == 0 || be[i] == 0)Q.push(i);
	}
	while (Q.size()) {
		int x = Q.front();
		Q.pop();
		if (used[x])continue;
		used[x]++;
		rep(i, G[x].size()) {
			if (s[x] == 'A')ae[G[x][i]]--;
			else be[G[x][i]]--;
			if (ae[G[x][i]] == 0 || be[G[x][i]] == 0)Q.push(G[x][i]);
		}
	}
	rep(i, n) {
		if (!used[i]) {
			puts("Yes"); return 0;
		}
	}
	puts("No");
}

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



int main(void){
	int N,i,tmp,keta=1,number=0;
	
	cin >> N;

	for (i = 1; i <= N; i++){
		tmp = i;
		keta = 1;
		while (1){
			tmp = tmp / 10;
			if (tmp >= 1){
				keta++;
			}
			else if (tmp < 1){
				break;
			}
		}
		if (keta % 2 == 1){
			number++;
		}
	}
	cout << number << endl;

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
 
int main(void)
{
 _Bool *list;
 int n,i,j,cnt;
 
 while(scanf("%d",&n) != EOF)
 {
  cnt = 0;
  list = (int*)calloc(n+1,sizeof(int));
  for(i = 2; i <= n; i++)
  {
   if(list[i] != 1) /*prime number:0 no prime numbers:1*/
   { 
    cnt++;
    for(j = i+i; j <= n; j+=i) list[j] = 1;
   }
  }
  printf("%d\n",cnt);
  free(list);
 } 
 return 0;
}

Measured memory_bytes: 4512
aI, aO, aT, aJ, aL, aS, aZ = map(int, input().split())

x, y, z = sorted([aI, aJ, aL])

ans = aO
if x == 0:
    ans += y//2 * 2 + z//2 * 2
else:
    ans += (x-1) * 3
    y -= x-1
    z -= x-1
    ans += max(3 + (z-1)//2 * 2 + (y-1)//2 * 2, z//2 * 2 + y//2 * 2)

print(ans)


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

int main(){
  int T;

  while(cin >> T){
    int level = 0;
    bool yesFlg = true;

    while(T--){
      char ch;
      int tim;
      cin >> ch >> tim;

      if(!yesFlg) continue;
      if(ch == '(') level += tim;
      else          level -= tim;

      if(level < 0) yesFlg = false;
    }

    if(level != 0) yesFlg = false;

    cout << (yesFlg ? "YES" : "NO") << endl;
  }
}

Measured memory_bytes: 1152
import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    n, k = map(int, input().split())
    buildings = list(map(int, input().split()))

    ans = float('inf')
    for i in range(2 ** n):
        res = 0
        cnt = 1
        prev_build = buildings[0]
        # 高くするビルをbitで管理
        for j in range(1, n):
            if (i >> j) & 1:
                cnt += 1
                if prev_build >= buildings[j]:
                    res += prev_build - buildings[j] + 1
                    prev_build += 1
                else:
                    prev_build = buildings[j]
            else:
                if prev_build < buildings[j]:
                    cnt += 1
                    prev_build = buildings[j]

        if cnt >= k:
            ans = min(ans, res)

    print(ans)       

if __name__ == '__main__':
    main()



Measured memory_bytes: 9160
#include<bits/stdc++.h>
using namespace std;
#define int long long
int dp[3005][3005];
int a[3005];
int n;
signed main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%lld", &a[i]);
	for(int i=1;i<=n;i++)dp[i][i]=a[i];
	for(int i=2;i<=n;i++)
		for(int j=1;i+j-1<=n;j++)
		dp[j][i+j-1]=max(a[j]-dp[j+1][i+j-1],-dp[j][i+j-2]+a[i+j-1]);
	printf("%lld\n",dp[1][n]);
}

Measured memory_bytes: 70016
#include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

int main() {
    long long N;
    cin >> N;
    vector<long long> a(N);
    for (int i=0; i<N; i++) {
        cin >> a[i];
    }
    
    long long zero=0, two=0, four=0;
    
    for (int i=0; i<N; i++) {
        if (a[i]%4==0) {
            four++;
        }
        else if (a[i]%2==0){
            two++;
        }
        else{
            zero++;
        }
    }
    
    bool can=false;
    if (zero<=four) {
        can=true;
    }
    else if (zero-1==four && two==0){
        can=true;
    }
    else{
        can=false;
    }
    
    if (can) {
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}


Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.Linq;
using static Scanner;

class Program
{
    static void Main() => new Program().Solve();

    public void Solve()
    {
        int n = ReadInt();
        int m = ReadInt();
        var ans = new ModInt();
        if (n == m)
        {
            ans = ModInt.Fact(n) * ModInt.Fact(m) * 2;
        }
        else if (n == m + 1 || n + 1 == m)
        {
            ans = ModInt.Fact(n) * ModInt.Fact(m);
        }
        else
        {
            ans = 0;
        }
        Console.WriteLine((int)ans);
    }
}

static class Scanner
{
    static Queue<string> que = new Queue<string>();
    public static string Read() { if (!que.Any()) foreach (var s in Console.ReadLine().Split()) que.Enqueue(s); return que.Dequeue(); }
    public static int ReadInt() => int.Parse(Read());
    public static long ReadLong() => long.Parse(Read());
    public static double ReadDouble() => double.Parse(Read());
    public static decimal ReadDecimal() => decimal.Parse(Read());
    public static IEnumerable<string> Read(long n) { for (long i = 0; i < n; i++) yield return Read(); }
    public static IEnumerable<int> ReadInt(long n) => Read(n).Select(int.Parse);
    public static IEnumerable<long> ReadLong(long n) => Read(n).Select(long.Parse);
    public static IEnumerable<double> ReadDouble(long n) => Read(n).Select(double.Parse);
    public static IEnumerable<decimal> ReadDecimal(long n) => Read(n).Select(decimal.Parse);
}

struct ModInt
{
    const int MOD = 1000000007;
    long value;
    static List<ModInt> fact = new List<ModInt> { 1 };
    public ModInt(long value) => this.value = value;
    public static implicit operator ModInt(long a) => new ModInt(a % MOD + (a < 0 ? MOD : 0));
    public static explicit operator int(ModInt a) => (int)a.value;
    public static ModInt operator +(ModInt a, ModInt b) => a.value + b.value;
    public static ModInt operator -(ModInt a, ModInt b) => a.value - b.value;
    public static ModInt operator *(ModInt a, ModInt b) => a.value * b.value;
    public static ModInt operator /(ModInt a, ModInt b) => a * Inv(b);
    public static ModInt Pow(ModInt a, int n) { if (n == 0) return 1; if (n == 1) return a; var p = Pow(a, n / 2); return p * p * Pow(a, n % 2); }
    public static ModInt Inv(ModInt a) => Pow(a, MOD - 2);
    public static ModInt Fact(int n) { for (int i = fact.Count; i <= n; i++) fact.Add(fact[^1] * i); return fact[n]; }
    public static ModInt Npr(int n, int r) => Fact(n) / Fact(n - r);
    public static ModInt Ncr(int n, int r) => Fact(n) / Fact(n - r) / Fact(r);
    public static ModInt Nhr(int n, int r) => Fact(n + r - 1) / Fact(n - 1) / Fact(r);
}

Measured memory_bytes: 30040
S=input()
T=input()
list1=[]
for i in range(len(S)-len(T)+1):
  a=S[i:(i+len(T))]
  cnt=0
  for j in range(len(T)):
    if a[j]!=T[j]:
      cnt=cnt+1
  list1.append(cnt)
b=min(list1)
print(b)

Measured memory_bytes: 8992
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll maxn=1e8+1000;
ll t,k;
int main(){
    //freopen("in.txt","r",stdin);
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>t>>k;
    k=k*k;
    ll a,b,res=0;
    for(int i=0;i<t;i++){
        cin>>a>>b;
        if(a*a+b*b<=k)  res++;
    }
    cout<<res<<endl;
    return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))

ll solve(ll n){
    if(n < 5){
        ll ans = 0;
        for(int i = 0; i <= n; i++) ans = ans ^ i;
        return ans;
    }
    ll beki = 1;
    while(beki * 2 < n) beki *= 2;
    if((n - beki) % 2 == 0) return beki + (solve(n - beki));
    return solve(n - beki);
}

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a, b;
    cin >> a >> b;

    ll ans = solve(b) ^ solve(a-1);

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define debug(a,b) cout << "debug : " << a << " , "<< b << endl;
using ll=long long;
const ll INF=1LL<<60;



int main(){
  int x,y,z;
  cin >> x >> y >> z;
  cout << z << " "<< x << " " << y;
}


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

int main() {
  int n,a;
  cin >> n;
  int b[n];
  b[0]=1234567890;
  cin >> b[1];
  b[2]=-1;
  int res=1;
  int j=0;
  int left=0;
  int right,mid;
  for(int i=1;i<n;i++){
    left=0;
    right=res+1;
    cin >> a;
    while(left<right){
      mid=(left+right)/2;
      if(b[mid]>=a)left=mid;
      if(b[mid]<a)right=mid;
      if(right-left==1)left=right;
    }
    if(b[right]==-1){
      b[right+1]=-1;
      res++;
    }
    b[right]=a;
  }
  cout << res << endl;
}


Measured memory_bytes: 640
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include <cassert>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
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; }
typedef long long ll;
typedef pair<int,int> P;

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

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

int main() {

  int a,b,c,d,e,f,g,h,i;
  cin >>a >>b >>c >>d >>e >>f >>g >>h >>i;
  if(a+e==b+d&&b+f==c+e&&d+h==e+g&&e+i==f+h){
  cout << "Yes" << endl;}
  else{
  cout << "No" << endl;}
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();

		if (a <= b) {
			System.out.print(a);
		} else {
			System.out.print(a - 1);
		}

	}

}

Measured memory_bytes: 21076
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#define REP(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

//#define LOCAL 0
//#ifdef LOCAL
//#define DEBUG(s) cout << (s) << endl
//#define dump(x)  cerr << #x << " = " << (x) << endl
//#define BR cout << endl;
//#else
//#define DEBUG(s) do{}while(0)
//#define dump(x) do{}while(0)
//#define BR
//#endif


//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 20)
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね

//ここから編集する


int main() {
    int N,A,B;
    int dp[401][401][41];

    cin >> N >> A >> B;

//    vector<int> a(N+1,-1);
//    vector<int> b(N+1,-1);
//    vector<int> c(N+1,-1);

    int a[41];
    int b[41];
    int c[41];

//    vector<int> a;
//    vector<int> b;
//    vector<int> c;

    REP(i,1,N+1){
        cin >> a[i] >> b[i] >> c[i];
    }

    REP(i,0,401){
        REP(j,0,401){
            REP(k,0,41){
               dp[i][j][k] = INF;
            }
        }
    }

    dp[0][0][0] = 0;
    REP(k,0,N){
        REP(i,0,401){
            REP(j,0,401){
                //使うパターン
                if(i + a[k+1] <= 400 && j + b[k+1] <= 400) dp[i + a[k+1]][j + b[k+1]][k + 1] = min(dp[i + a[k+1]][j + b[k+1]][k + 1],dp[i][j][k] + c[k+1]);
                //使わないパターン
                dp[i][j][k+1] = min(dp[i][j][k+1],dp[i][j][k]);
            }
        }
    }

    int ans = INF;
    REP(i,1,100){
        int Ma = A * i;
        int Mb = B * i;
        if(Ma >= 401 || Mb >= 401)break;
        ans = min(ans,dp[Ma][Mb][N]);
    }


    if(DEBUG){
        cout << "--" << endl;
        REP(i,0,10){
            REP(j,0,10){
                cout << dp[i][j][N] << " ";
            }
            cout << endl;
        }
        cout << "--" << endl;
    }

    if(ans == INF) ans = -1;
    cout << ans << endl;


    return 0;
}


Measured memory_bytes: 25984
#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<math.h>


#define CI cin >>
#define CO cout <<
#define E << endl;

using namespace std;

int main(void) {
	int a, b = 0;

	CI a >> b;

	//CO a / b << " " << a % b << " " << (double)a / (double)b E

	printf("%d %d %f",a / b,a % b,(double)a / (double)b);

}

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

#define f first
#define s second
#define ll long long
#define pb push_back
#define mp make_pair
#define inp(x) cin>>x
#define print(x) cout<<x
#define pii pair<int,int>
#define pll pair<ll,ll>
#define gcd(a,b) __gcd(a,b)
#define reset(d,val) memset(d,val,sizeof(d))
#define sort(v) sort(v.begin(),v.end())
#define sort_arr(arr,i,f) sort(arr+i,arr+f)
#define pq priority_queue<int,vector<int>,greater<int> >
#define pq1 priority_queue<pll,vector<pll>,greater<pll> >

const int mod = 1e9+7;

int n,k;
int arr[101];
bool dp[100001][2];

bool f(int k,int s) {
	if(dp[k][s]) return dp[k][s];
	bool ans = 0;
	for (int i = 0; i < n; ++i)
	{
		if(k-arr[i]>=0) {
			ans |= !f(k-arr[i],!s);
		}
	}
	return dp[k][s] = ans;
}

int main(int argc, char const *argv[])
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin>>n>>k;
	for (int i = 0; i < n; ++i)
	{
		cin>>arr[i];
	}
	if(!f(k,0)) cout<<"Second";
	else cout<<"First";
	return 0;
}


Measured memory_bytes: 5120
#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int,int> P;
using ll = long long;
using VI = vector<int>;

int main(){
    map<int,int> vec;
    int n;cin >> n;
    rep(i,n){
        int data;cin >> data;
        if(vec[data]==0) vec[data] = 1;
        else vec[data] = 0;
    }
    int ans = 0;
    for(auto &i:vec){
        if(i.second!=0) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 4864
n,m=list(map(int,input().split()))
M=[list(map(int,input().split())) for _ in range(m)]
M.sort(key=lambda X: X[1])
end,ans=0,0

for i in range(m):
  if M[i][0] >= end:
    ans += 1
    end=M[i][1]
print(ans)

Measured memory_bytes: 29080
#include <cstdio>
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#define rep(i,n) for (int i=0;i<n;i++)
using ll = long long;
using namespace std;

void solve(){

}
int main (){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int a,b,c;
    cin >> a >> b >>c;
    if(b-a+1<=2*c){
        for(int i=a;i<b+1;i++){
            cout << i << endl;
        }
    }
    else{
        for(int i=a;i<a+c;i++){
            cout << i << endl;
        }
        for(int j=b-c+1;j<b+1;j++){
            cout << j << endl;
        }
    }

    return 0;
}

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

int main() {
  int n;
  cin >> n;
  
  vector<int> l(n);
  for(int i = 0; i < n; i++) cin >> l.at(i);
  
  sort(l.begin(), l.end());
  
  int a, b, c, ans = 0;
  for(int i = 2; i < n; i++){
    a = l.at(i);
    for(int j = 1; j < i; j++){
      b = l.at(j);
      for(int k = 0; k < j; k++){
        c = l.at(k);
        if(a < b + c && b < a + c) ans++;
      }
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
use std::io::{Read, stdin};
use std::str::FromStr;
use std::collections::HashMap;

fn main(){
    let w :String = read();
    let mut m: HashMap<char, u32, _> = HashMap::new();
    let mut cnt: u32;
    for i in w.as_str().chars() {
        match m.get(&i) {
            Some(&j) => cnt = j + 1,
            None => cnt = 1,
        };
        m.insert(i, cnt);
    }
    let mut is_single: bool = true;
    for (_k, v) in &m {
        if v % 2 == 1 {is_single = false}
    }
    println!("{}", if is_single{ "Yes".to_string()}else{"No".to_string()});
}

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

Measured memory_bytes: 4352
import java.math.BigDecimal;
import java.util.Scanner;

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

		int N = sc.nextInt();
		long ans = 1;
		long[] A = new long[N];

		for(int i=0; i<N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) {
				System.out.println(0);
				return ;
			}
		}

		for(int i=0; i<N; i++) {
			long a = A[i];
			if(Math.log10(ans) + Math.log10(a) > 18) {
				System.out.println(-1);
				return;
			}
			ans *= a;

		}


		if(ans <= 1000000000000000000l) {
			System.out.println(ans);
		}else {
			System.out.println(-1);
		}

	}
}



Measured memory_bytes: 62168
#include <iostream>
#include <iosfwd>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <cassert>
#include <cctype>
#include <climits>
#include <vector>
#include <bitset>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <deque>
#include <string>
#include <list>
#include <iterator>
#include <sstream>
#include <complex>
#include <fstream>
#include <functional>
#include <numeric>
#include <utility>
#include <algorithm>
#include <assert.h>
#define lli long long int
#define lower(a) transform(a.begin(),a.end(),a.begin(),::tolower);


using namespace std;

const int N = 3e5 + 500;
const long long mod = 1e9 + 7;
const long long INF = 1LL << 57;
const int M = 1e6 + 500;

vector<lli> graph[N];
//map<pair<lli, lli> , bool> vis;
lli ans = 0;
bool ok[N];
lli dp[N];

void dfs(lli u)
{
    ok[u] = 1;
//    cnt ++;
//  ans = max(ans, cnt);
  //  cout<<"YES"<<endl;
    for(auto it : graph[u])
    {
//        cout<<"IN"<<endl;
        if(!ok[it])
            dfs(it);
        dp[u] = max(dp[u], 1 + dp[it]);
    }
}


void solve()
{
    lli n, m;
    cin>>n>>m;

    for(int i = 0; i < m; i ++)
    {
        lli u, v;
        cin>>u>>v;
        graph[u].push_back(v);
    }
    for(int i = 1; i <= n; i ++)
    {
        if(ok[i])
            continue ;
        dfs(i);
    //    cout<<"NO"<<endl;
    }
    lli ans = 0;
    for(int i = 1; i <= n; i ++)
        ans = max(ans, dp[i]);
    cout<<ans;
    return ;
}
/*
10
6
10 3 2 5 7 8
*/
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    lli t;
    t = 1;
//    cin>>t;
    while(t --)
    {
        solve();
    }
    return 0;
}


Measured memory_bytes: 13824
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

typedef struct{
    int a;
    int b;
}data;

//昇順
int asc(const void* a, const void* b){
    data p=*(data*)a;
    data q=*(data*)b;
    if(p.a!=q.a) return p.a-q.a;
    else return p.b-q.b;
}

int main(void){
    long H,W;
    int N;
    scanf("%ld%ld%d",&H,&W,&N);

    data* A;
    NEW(A,9*N);
    int cnt=0;
    for(int i=0;i<N;i++){
        int a,b;
        scanf("%d%d",&a,&b);
        for(int j=0;j<=2;j++){
            for(int k=0;k<=2;k++){
                if(1<=a-j && a-j<=H-2 && 1<=b-k && b-k<=W-2){
                    A[cnt].a=a-j;
                    A[cnt].b=b-k;
                    cnt++;
                }
            }
        }
    }
    //for(int i=0;i<cnt;i++) printf("%d %d\n",A[i].a,A[i].b);
    qsort(A,cnt,sizeof(data),asc);

    long ans[10];
    ans[0]=(H-2)*(W-2);
    for(int i=1;i<10;i++) ans[i]=0;

    int c=1;
    for(int i=1;i<cnt;i++){
        if(A[i-1].a==A[i].a && A[i-1].b==A[i].b) c++;
        else{
            ans[c]++;
            c=1;
        }
    }
    if(cnt) ans[c]++;

    long sum=0;
    for(int j=1;j<10;j++) sum+=ans[j];
    ans[0]-=sum;

    for(int i=0;i<10;i++) printf("%ld\n",ans[i]);

    return 0;
}

Measured memory_bytes: 14204
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())
#define endl "\n"


template <typename T, typename K> struct P {
	T a; K b;
};

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
vector <P <ll, ll> >prime_factorize( ll N );
ll pow( ll a, ll n );
void initialize( void );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;
int main( void ){
	// initialize();
	int L, R, d;
	cin >> L >> R >> d;
	cout << abs((( L - 1 ) / d ) - ( R / d )) << endl;
}

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

/*
 * @fn eratosthenes
 * @brief O(NloglogN)~=(N)
 * @param N: その数まで
 * @return 0 or 1 の配列 (boolは都合が悪い)
 */
int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}

/*
 * @fn prime_factorize
 * @brief O(√N): 素因数分解
 * @param N: 素因数分解する数
 * @return vec: (a: 素数, b: 個数)
 */
vector <P <ll, ll> >prime_factorize( ll N ){
	vector <P <ll, ll> > vec;
	int lim = sqrt( N ) + 1;
	rep( i, 2, N + 1 ){
		if (i >= lim){
			vec.push_back( P <ll, ll>{N, 1} );
			break;
		}
		if (N % i == 0){
			vec.push_back( P <ll, ll>{i, 0} );
			while(N % i == 0){
				N /= i;
				vec.back().b++;
			}
		}
	}
	return vec;
}
/*
 * @fn pow
 * @brief a^n
 * @param a: 基数
 * @param n: 指数
 */
ll pow( ll a, ll n ) {
	ll res = 1;
	while (n > 0){
		if (n & 1) res = res * a;
		a = a * a;
		n >>= 1;
	}
	return res;
}

void initialize( void ){
	cout << fixed << setprecision( 10 );
}


Measured memory_bytes: 3492
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>

using namespace std;

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

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define rep(i,x) for(int i=0;i<(x);++i)
#define rep1(i,x) for(int i=1;i<=(x);++i)
#define rrep(i,x) for(int i=(x)-1;i>=0;--i)
#define rrep1(i,x) for(int i=(x);i>=1;--i)
#define FOR(i,a,x) for(int i=(a);i<(x);++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)

template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>T get(){T a;cin>>a;return a;}
template<typename T>T rev(T a){reverse(all(a));return a;}
template<typename T>istream&operator>>(istream&is,vector<T>&vec){rep(i,vec.size())is>>vec[i];return is;}
template<typename T>vector<T>&sort(vector<T>&a){sort(all(a));return a;}

const int inf = 1e9;
const ll linf = 3e18;
const double eps = 1e-9;

struct UF {
    vi data;
    void init(int n)
    {
        data.resize(n);
        fill(all(data), -1);
    }
    int root(int x)
    {
        return data[x] < 0 ? x : data[x] = root(data[x]);
    }
    void unite(int x, int y)
    {
        x = root(x);
        y = root(y);
        if (x == y) return;
        if (size(x) < size(y)) swap(x, y);
        data[x] += data[y];
        data[y] = x;
    }
    bool same(int x, int y)
    {
        return root(x) == root(y);
    }
    int size(int x)
    {
        return -data[x];
    }
    bool is_root(int x)
    {
        return x == root(x);
    }
};

UF uf;

int main()
{
    omajinai;

    int N, M; cin >> N >> M;

    uf.init(N + 1);

    rep1(i, M) {
        int a, b; cin >> a >> b;
        uf.unite(a, b);
    }

    int city = 0, village = 0;

    rep1(i, N) {
        if (uf.is_root(i)) {
            (uf.size(i) > 1 ? city : village)++;
        }
    }

    cout << abs(city - village) << endl;
}

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

int main(){
  int N;
  long long count;
  cin >> N;
  vector<int> a(N);
  count = 0;
  
  for(int i = 0;i < N;i++){
     cin >> a.at(i);
    if(i > 0){
      if(a.at(i-1) > a.at(i)){
        count += a.at(i-1) - a.at(i);
        a.at(i) = a.at(i-1);
      }
    }
  }
  cout << count << endl;
  
}

Measured memory_bytes: 4048
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;

int main()
{
    LL a,b,c,k,ans;
    cin>>a>>b>>c>>k;
    if(k%2)ans=b-a;
    else ans=a-b;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <list>

#define V 10000
#define E 100000
#define WMAX 10000

using namespace std;

struct Edge{
    int e1;
    int e2;
    int weight;
    
    Edge(int E1, int E2, int w){
        e1 = E1;
        e2 = E2;
        weight = w;
    }
};

int Input(list<Edge>&);
void Kruskal(list<Edge>&, int);
bool comp_weight(const Edge&, const Edge&);


class UFind{
private:
    vector<int> par;
    vector<int> rank;
    vector<int> diff_weight;
    
    int root(int x) {
        if (par[x] == x)
            return x;
        else {
            int r = root(par[x]);
            diff_weight[x] += diff_weight[par[x]];
            return par[x] = r;
        }
    }
    
    int weight(int x) {
        root(x);
        return diff_weight[x];
    }
    
public:
    UFind(int n) {
        for (int i = 0; i < n; ++i){
            par.push_back(i);
            rank.push_back(0);
            diff_weight.push_back(0);
        }
    }
    
    bool issame(int x, int y) {
        return root(x) == root(y);
    }
    
    int diff(int x, int y) {
        return weight(y) - weight(x);
    }
    
    bool merge(int x, int y, int w) {
        w += weight(x);
        w -= weight(y);
        x = root(x);
        y = root(y);
        
        if (x == y)
            return false;
        
        if (rank[x] < rank[y]){
            swap(x, y);
            w = -w;
        }
        
        if (rank[x] == rank[y])
            ++rank[x];
        
        par[y] = x;
        diff_weight[y] = w;
        
        return true;
    }
};


int main(){
    list<Edge> EdgeData;
    int VertexNum = Input(EdgeData);
    
    if(VertexNum == -1)
        return -1;
    
    Kruskal(EdgeData, VertexNum);
    
    return 0;
}


int Input(list<Edge> &EdgeData){
    int s, t, w;
    int VN, EN;
    
    cin >> VN >> EN;
    if(!(1 <= VN && VN <= V) || !(0 <= EN && EN <= E))
        return -1;
    
    for(int i = 0; i < EN; i++){
        cin >> s >> t >> w;
        if(!(0 <= w && w <= WMAX) || !(0 <= s && s < VN) || !(0 <= t && t < VN))
            return -1;
        
        EdgeData.emplace_back(s, t, w);
    }
    
    EdgeData.sort(comp_weight);
    
    return VN;
}

void Kruskal(list<Edge> &EdgeData, int VertexNum){
    UFind uf(VertexNum);
    int TW = 0;
    
    while(!EdgeData.empty()){
        Edge et = EdgeData.front();
        EdgeData.pop_front();
        
        if(!uf.issame(et.e1, et.e2)){
            uf.merge(et.e1, et.e2, et.weight);
            TW += et.weight;
        }
    }
    
    cout << TW << endl;
}

bool comp_weight(const Edge &e1, const Edge &e2){
    return e1.weight < e2.weight;
}



Measured memory_bytes: 7872
INF=10**9+7
n,k=map(int,input().split())
graph=[[] for i in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
ans=1
check=[False]*n
import sys
sys.setrecursionlimit(10**6)
stack=[0]
ans=1
while len(stack)>0:
    x=stack.pop()
    check[x]=True
    count=0
    for i in graph[x]:
        if not check[i]:
            count+=1
            stack.append(i)
    if x==0:
        temp=1
        for i in range(count):
            temp=temp*(k-1-i)%INF
        ans=ans*temp%INF
    else:
        temp=1
        for i in range(count):
            temp=temp*(k-2-i)%INF
        ans=ans*temp%INF
print((ans*k)%INF)
        


Measured memory_bytes: 69536
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	if a > b {
		fmt.Println(gcd(a, b))
	} else {
		fmt.Println(gcd(b, a))
	}
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	} else {
		return gcd(b, a%b)
	}
}



Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+5;
char s[maxn][15];
typedef long long ll;
ll a[10];
int main()
{
    int n;
    while(cin>>n)
    {
        memset(a,0,sizeof(a));
        for(int i=0;i<n;i++)
        {
            scanf("%s",s[i]);
            if(s[i][0]=='M')
                a[1]++;
            else if(s[i][0]=='A')
                a[2]++;
            else if(s[i][0]=='R')
                a[3]++;
            else if(s[i][0]=='C')
            a[4]++;
            else if(s[i][0]=='H')
                a[5]++;
        }
        ll da=0;
        for(int i=1;i<=5;i++)
            for(int j=i+1;j<=5;j++)
            for(int k=j+1;k<=5;k++)
            da+=a[i]*a[j]*a[k];
        cout<<da<<endl;
    }
}






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

using namespace std;
const int N = 5e5 + 10;
const int MOD = 1e9 + 7;

void _psum (int &, int);
int _sum (int, int);
int _mul (int, int);
int _pow (int, int);
int gcd (int, int);

int n, m, k, inv[N], f[N], res[N];
vector <int> X;

int x[] = {0, 0, -1, +1};
int y[] = {-1, +1, 0, 0};
string s[N];

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

	long long a, b, c, x, y;
	cin >> a >> b >> c >> x >> y;

	long long ans = LLONG_MAX;
	for (int i = 0; i / 2 <= max(x, y); i++) {
		long long cur = i * c;
		if (i / 2 < x) 
			cur += (x - i / 2) * a;
		if (i / 2 < y)
			cur += (y - i / 2) * b;
		ans = min(ans, cur);
	}
	cout << ans << endl;
}

int gcd (int a, int b) {
	return !b? a : gcd (b, a % b);
}

// int choose (int r, int k) {
// 	return _mul (f[k], _mul(inv[r], inv[k - r]));
// }

void _psum (int &a, int b) {
	a += b;
	if (a >= MOD)
		a -= MOD;
}

int _sum (int a, int b) {
	return a + b - (a + b >= MOD? MOD : 0);
}

int _mul (int a, int b) {
	return 1LL * a * b % MOD;
}

int _pow (int a, int b) {
	if (!b) 
		return 1;
	int res = _pow (a, b >> 1);
	res = _mul (res, res);
	if (b & 1)
		res = _mul (res, a);
	return res;
}

// SamMHD :: Jun27-2019 :: Another Day with Shayan...

Measured memory_bytes: 4352
#include <iostream>
#include <iomanip>
#include <math.h>
#include <algorithm>
#include <functional> 
#include <string>
#include <vector>

#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>
#include <limits.h>

using namespace std;

typedef long long LL;

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define dump(c) { for (auto it = c.begin(); it != c.end(); ++it) if (it == c.begin()) cout << *it; else cout << ' ' << *it; cout << endl; } 
#define dumpMap(m) { for (auto it: m) cout << it.first << "=>" << it.second << ' '; }

const int MOD = 1000000007;

double dp[3000][3000];

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

    char hc = S[0];
    LL hl = 1;
    int index = 1;
    while (index < S.length() && S[index] == hc) {
        ++hl;
        ++index;
    }

    if (index == S.length()) {
        //! S is a series of same characters
        cout << ((LL) S.length() * K / 2) << endl;
        return 0;
    }

    char tc = S[S.length()-1];
    LL tl = 1;
    int endIndex = S.length()-2;
    while (0 < endIndex < S.length() && S[endIndex] == tc) {
        ++tl;
        --endIndex;
    }

    LL changePerS = 0;
    // cout << "index = " << index << ", endIndex=  " << endIndex << endl;
    while (index <= endIndex) {
        char cc = S[index];
        LL cl = 0;
        while (index <= endIndex && S[index] == cc) {
            ++cl;
            ++index;
        }
        // cout << "    cc = " << cc << ", cl = " << cl << endl;
        changePerS += cl / 2;
    }

    // cout << hl << ' ' << tl << ' ' << changePerS << endl;

    LL ans = 0;
    if (hc == tc) {
        ans = hl/2 + ((hl+tl)/2) * (K-1) + tl/2 + changePerS * K;
    } else {
        ans = (hl/2 + changePerS + tl/2) * K;
    }

    cout << ans << endl;

    return 0;
}


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

const int N=300005;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;
 
int R, C, n;
int onedge(int x, int y) {
	if(x == 0) return 1;
	if(x == R) return 2;
	if(y == 0) return 3;
	if(y == C) return 4;
	return 0;
}

int num;
int v[N],r[N],to[N];
vector<pii> vs[4];

void ins() {
	int d[] = {0, 3, 1, 2};
	rep(i,0,4) {
		int c = d[i];
		rep(j,0,vs[c].size()) {
			int id = vs[c][j].second;
			v[++num]=(id);
			if(!r[id]) r[id] = num;
			else {
				to[num] = r[id];
				to[r[id]] = num;
			}
		}
    }
}

bool check(int l,int r) {
	if(l>r) return 1;
	if(to[l]>r||to[l]<l) return 0;
	return check(l+1,to[l]-1)&&check(to[l]+1,r);
}
 
int main() {
	cin >> R >> C >> n;
	rep(i,0,n) {
		int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;
		int a = onedge(x1, y1);
		int b = onedge(x2, y2);
		if(a && b) {
			a--; b--;
			vs[a].push_back(pii((a/2 ? x1 : y1), i));
			vs[b].push_back(pii((b/2 ? x2 : y2), i));
		}
	}
	sort(vs[0].begin(), vs[0].end());
	sort(vs[3].begin(), vs[3].end());
	sort(vs[1].begin(), vs[1].end(), greater<pii>());
	sort(vs[2].begin(), vs[2].end(), greater<pii>());
	ins();
	
	cout << (check(1,num) ? "YES" : "NO") << endl;
	return 0;
}
/*
2 2 2
0 0 1 2
0 1 2 2
*/

Measured memory_bytes: 5656
#include<bits/stdc++.h>
#define PI 3.141592653589
#define ll long long
using namespace std;

int main(){
  int h, w;
  string s[55];
  cin >> h >> w;

  for(int i=0; i<h; i++) cin >> s[i];
  for(int i=0; i<h; i++){
    for(int j=0; j<w; j++){
      if(s[i][j] == '#') cout <<'#';
      else{
        int cnt = 0;
        for(int dx=-1; dx<=1; dx++){
          for(int dy=-1; dy<=1; dy++){
            int tx = i+ dx, ty = j + dy;
            if(0<=tx && tx<h && 0 <= ty && ty < w && s[tx][ty] == '#') cnt++;
          }
        }
        cout << cnt;
      }
    }
    cout << endl;
  }
  return 0;
   
}

Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <cctype>
#include <complex>
#include <regex>

using namespace std;

#define C_MAX(a, b) ((a)>(b)?(a):(b))
#define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOW_MAP(v) {std::cerr << #v << endl; for(const auto& xxx: v){std::cerr << xxx.first << " " << xxx.second << "\n";}}

constexpr int MAX_N = 1000010;


struct edge {
    int to;
    long long cost;
};

vector<edge> G[MAX_N];

void bfs(int N, int v, vector<bool> &used, vector<long long> &dist, bool &good, long long cost) {
    if (used[v]) {
        if (dist[v] != cost) good = false;
    } else {
        used[v] = true;
        dist[v] = cost;
        for (int i = 0; i < G[v].size(); i++) bfs(N, G[v][i].to, used, dist, good, cost + G[v][i].cost);
    }
}

int main() {

    int N, M;
    cin >> N >> M;

    for (int i = 0; i < M; i++) {
        int L, R, D;
        cin >> L >> R >> D;
        L--, R--;
        G[L].push_back((edge) {R, D});
        G[R].push_back((edge) {L, -D});
    }
    vector<bool> used(N, false);
    vector<long long> dist(N, -1);
    dist[0] = 0;
    bool good = true;
    for (int i = 0; i < N; i++) {
        if (!used[i]) {
            dist[i] = 0;
            bfs(N, i, used, dist, good, 0LL);
        }
    }


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

    return 0;
}




























Measured memory_bytes: 39424