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

int main(){
  int n;
  cin >> n;
  if(n % 2 == 0){
    cout << (n/2) * (n/2) << endl;
  }else{
    cout << (n/2) * ((n/2)+1) << endl;
  }
  return 0;
}

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

int main() {
	// your code goes here
	string s;
	cin >> s;
	if(s == "Sunny")
	{cout << "Cloudy" << endl;}
	else if(s == "Cloudy")
	{cout << "Rainy" << endl;}
	else
	{cout << "Sunny" << endl;}
	return 0;
}

Measured memory_bytes: 256
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>

using namespace std;

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

    const size_t L = S.size();

    for (size_t i = 0; i < L - 2; ++i) {
        if (S[i] == S[i+1]) {
            std::cout << i+1 << " " << i+1+1 << std::endl;
            return 0;
        }
        if (S[i] == S[i+2]) {
            std::cout << i+1 << " " << i+2+1 << std::endl;
            return 0;
        }
    }
    // 最後
    if (S[L-2] == S[L-1]) {
        std::cout << L-2+1 << " " << L-1+1 << std::endl;
        return 0;
    }

    std::cout << "-1 -1" << std::endl;
    return 0;
}


Measured memory_bytes: 512
W, H, N = map(int, input().split())
xya=[]
for _ in range(N):
    xya.append(tuple(map(int, input().split())))
#print(xya)
left=0
right=W
top=H
bottom=0
for el in xya:
    if el[2]==1:
        if left<el[0]:
            left=el[0]
    if el[2]==2:
        if right>el[0]:
            right=el[0]
    if el[2]==3:
        if bottom<el[1]:
            bottom=el[1]
    if el[2]==4:
        if top>el[1]:
            top=el[1]
    #print(left, right, top, bottom)
if left<right and bottom<top:
    print((right-left) * (top-bottom))
else:
    print(0)


Measured memory_bytes: 3064
import sys
sys.setrecursionlimit(10**9)

N = int(input())
T = [[] for _ in range(N+1)]

for _ in range(N-1) :
    a,b,c = map(int,input().split())
    T[a].append([b,c])
    T[b].append([a,c])

Q,K = map(int,input().split())

dist = [None]*(N+1)

def dfs(now,d) :
    dist[now] = d
    for to,c in T[now] :
        if dist[to] is not None :
            continue
        dfs(to,d+c)

dfs(K,0)

for _ in range(Q) :
    u,v = map(int,input().split())
    ans = dist[u] + dist[v]
    
    print(ans)


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

ll a[1000100], b[1000100];

int main(){
    ll n;
    cin >> n ;
    for(ll i=0 ; i<n ; i++){
        cin >> a[i] >> b[i];
    }
    ll c=0, x=0;
    for(ll i=n-1 ; i>=0 ; i--){
        if((a[i]+c) % b[i] != 0){
            c += b[i] - ((a[i]+c) % b[i]);
        }
    }
    cout << c << '\n';
    return 0;
}


Measured memory_bytes: 1792
import java.util.*;
public class Main{
		private static Scanner sc;
	    public static void main(String[] args){
	    	int A[] = new int[33];
	        A[0]=1;
	        for (int i=1; i<=32; i++){
	        	A[i]=A[i-1];
	        	if (i>1) A[i]+=A[i-2];
	        	if (i>2) A[i]+=A[i-3];
	        }
	        sc = new Scanner(System.in);
			int a;
			while ((a=sc.nextInt())>0){
				System.out.println((int)(Math.ceil(A[a]/3650))+1);
	        }
	}
}

Measured memory_bytes: 25816
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define P pair<ll,ll>
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,a,b,ans=0;cin>>n>>a>>b;
  lvector X(n,0),D(n-1,0);rep(i,n) cin>>X[i];
  rep(i,n-1) D[i]=X[i+1]-X[i];
  for(ll d:D) {
    if(d*a<=b) ans+=d*a;
    else ans+=b;
  }
  print(ans);
  return 0;
}

Measured memory_bytes: 1792
def partition(arr, p, r):
    x = arr[r]
    index = p - 1  # arr[p,index] <= x,arr[index+1,i)>x
    for i in range(p, r):
        if arr[i] <= x:
            arr[i], arr[index + 1] = arr[index + 1], arr[i]
            index += 1
    arr[index + 1], arr[r] = arr[r], arr[index + 1]
    return index + 1


if __name__ == '__main__':
    n = int(input())
    arr = list(map(int, input().split()))
    index = partition(arr, 0, n - 1)
    for i in range(n):
        if i != 0:
            print(' ', end='')
        if i == index:
            print('[', end='')
        print(arr[i], end='')
        if i == index:
            print(']', end='')
    print()



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

int main(int argc, char const *argv[])
{
  int n, k, x, y;
  cin >> n >> k >> x >> y;
  cout << (n - k > 0 ? k*x + (n-k)*y : n*x) << flush;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
  int N,ans;
  cin >> N;
  if (N==10 || N==100 || N==1000 || N==10000 || N==100000) {
    ans = 10;
  } else {
    ans = N/10000 + (N%10000)/1000 + (N%1000)/100 + (N%100)/10 + (N%10);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 888
import math  # noqa: F401
from collections import deque  # noqa: F401
from typing import Deque, Dict, List, Optional, Tuple, Union  # noqa: F401


def main(X: int):
    print(f"{10-X//200}")


if __name__ == "__main__":
    X = int(input())
    main(X)


Measured memory_bytes: 10224
import java.util.*;
 
import java.io.*;
 
public class Main{
	public static void main(String[] $){
		Scanner s = new Scanner(System.in);
        int N = s.nextInt();
        long K = s.nextLong();
        int[] A = new int[N];
        for(int i = 0; i < N; i++){
            A[i] = s.nextInt();
        }
        HashMap<Integer, Boolean> hash = new HashMap<Integer, Boolean>();
        List<Integer> amari = new ArrayList<Integer>();
        int[] noroop = new int[N];
        int i = 1;
        do{
            amari.add(i);
            hash.put(i, true);
            i = A[i-1];
        }while(hash.get(i) == null);
        int roopPrev = amari.indexOf(i);
        int[] rooping = new int[N];
        for(int j = 0; j < roopPrev; j++){
            noroop[j] = amari.get(j);
        }

        for(int j = roopPrev; j < amari.size(); j++){
            rooping[j-roopPrev] = amari.get(j);
        }

        int roopN = amari.size()-roopPrev;
        if(K >= roopPrev){
            System.out.println(rooping[(int)((K-roopPrev)%roopN)]);
        }else{
            System.out.println(noroop[(int)K]);
        }
        
	}
} 

Measured memory_bytes: 66380
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static void Main(string[] args)
    {
        var sc = new Scanner();
        int n = sc.NextInt();
        int m = sc.NextInt();
        int[] p = new int[n];
        for (int i = 0; i < n; i++) p[i] = sc.NextInt() - 1;

        var t = new UnionFindTree(n);
        for (int i = 0; i < m; i++)
        {
            int x = sc.NextInt() - 1;
            int y = sc.NextInt() - 1;
            t.Unite(x, y);
        }
        int ans = 0;
        for (int i = 0; i < n; i++)
        {
            if (t.Same(i, p[i])) ans++;
        }
        Console.WriteLine(ans);
    }
}

class UnionFindTree
{
    private List<Node> list = new List<Node>();

    public UnionFindTree(int count)
    {
        for (int i = 0; i < count; i++)
            list.Add(new Node() { Parent = i, Depth = 0 });
    }


    public int Find(int x)
    {
        if (list[x].Parent == x) return x;
        return list[x].Parent = Find(list[x].Parent);
    }

    public void Unite(int x, int y)
    {
        int px = Find(x);
        int py = Find(y);
        if (px == py) return;

        if (list[px].Depth < list[py].Depth)
        {
            list[px].Parent = py;
        }
        else
        {
            list[py].Parent = px;
            if (list[px].Depth == list[py].Depth) list[px].Depth++;
        }
    }

    public bool Same(int x, int y)
    {
        return Find(x) == Find(y);
    }


    class Node
    {
        public int Parent { get; set; }
        public int Depth { get; set; }
    }
}

class Scanner
{
    int index = -1;
    string[] buf;

    public Scanner()
    {
    }

    public int NextInt()
    {
        CheckNext();
        return int.Parse(buf[index++]);
    }

    public long NextLong()
    {
        CheckNext();
        return long.Parse(buf[index++]);
    }

    public double NextDouble()
    {
        CheckNext();
        return double.Parse(buf[index++]);
    }

    public string NextString()
    {
        CheckNext();
        return buf[index++];
    }

    private void CheckNext()
    {
        if (index >= 0 && index < buf.Length) return;

        buf = Console.ReadLine().Split(' ');
        index = 0;
    }
}


Measured memory_bytes: 26844
#include<iostream>
using namespace std;
int main()
{
    char a[4];
    cin>>a;
    int f=0,i;
    for(i=0;i<3;i++)
    {
        if(a[i]=='7')
        {
            cout<<"Yes";
            f=1;
            break;
        }
    }
    if(f==0)
    {
        cout<<"No";
    }
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18;
const int MOD = 1e9 + 7;

int main() {
    int N;
    cin >> N;
    bitset<101> sum;
    sum[0] = true;
    for(int i = 0; i < N / 4; ++i)
        sum = (sum << 7) | (sum << 4) | sum;
    cout << (sum[N] ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define rep(I,N) for(auto I=0;I<(N);++I)
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
typedef long long ll;
typedef unsigned long long ull;
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;}
template<class T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                                      ins(T &p){for_each(all(p),in<decltype(p[0])>);}
template<class T>inline void                             out(T p){cout<<p<<endl;}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<endl;}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<endl;}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<endl;}
inline                                              void out(double p){printf("%.10f\n",p);}
template<class T>inline                             void outs(T p){for_each(all(p),out<decltype(p[0])>);}
template<class T>inline void outs(vector<T> V){int n=V.size();rep(i,n)cout<<V[i]<<" \n"[i==n-1];}
long myabs(long a){
  if(a>0)return a;
  else return a*(-1);
}
inline void solve(void){
  int N;in(N);
  vector<long>A(N);ins(A);
  long sum=accumulate(all(A),0L),sum2=0,ans=LONG_MAX;
  rep(i,N-1){
    sum2+=A[i];
    chmin(ans,myabs(sum2*2-sum));
  }
  out(ans);
}
int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


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

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String[] t  = sc.nextLine().split(" ");
		int n       = Integer.parseInt(t[0]);
		int k       = Integer.parseInt(t[1]);

		String[] t1 = sc.nextLine().split(" ");
		int r       = Integer.parseInt(t1[0]);
		int s       = Integer.parseInt(t1[1]);
		int p       = Integer.parseInt(t1[2]);

		char[] x = sc.nextLine().toCharArray();
		char[] y = new char[n];
		int ans = 0;

		for(int i = 0; i < n; i++) {
			if(i >= k) {
				switch(x[i]){
					case 'r':
						if(y[i - k] != 'p') {
							ans += p;
							y[i] = 'p';
						}else {
							y[i] = 'z';
						}
						break;
					case 's':
						if(y[i - k] != 'r') {
							ans += r;
							y[i] = 'r';
						}else {
							y[i] = 'z';
						}
						break;
					case 'p':
						if(y[i - k] != 's') {
							ans += s;
							y[i] = 's';
						}else {
							y[i] = 'z';
						}
						break;
				}
			}else {
				switch(x[i]){
					case 'r':
						ans += p;
						y[i] = 'p';
						break;
					case 's':
						ans += r;
						y[i] = 'r';
						break;
					case 'p':
						ans += s;
						y[i] = 's';
						break;
				}
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 40784
import math
import sys
from decimal import Decimal


N = int(sys.stdin.readline())
TA = []
for i in range(N):
    TA.append(list(map(int, sys.stdin.readline().split())))

current_T = 1
current_A = 1
for i in range(N):
    count = max(math.ceil(Decimal(current_T)/Decimal(TA[i][0])), math.ceil(Decimal(current_A)/Decimal(TA[i][1])))
    current_T = TA[i][0] * count
    current_A = TA[i][1] * count

print(current_T + current_A)


Measured memory_bytes: 5332
#include<cstdio>

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

using namespace std;

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

int w,h;
char B[20][21];

int dfs(int i,int j){
	B[i][j]='#';
	int res=1;
	rep(k,4){
		int y=i+dy[k],x=j+dx[k];
		if(0<=y && y<h && 0<=x && x<w && B[y][x]=='.') res+=dfs(y,x);
	}
	return res;
}

int main(){
	for(;scanf("%d%d",&w,&h),w;){
		rep(i,h) scanf("%s",B[i]);
		rep(i,h) rep(j,w) if(B[i][j]=='@') printf("%d\n",dfs(i,j));
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <functional>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define EB emplace_back
#define GREATER(T) T, VT<T> greater<T>
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

const int MAX = 111 * 111;
int N, K;
PII ans[MAX];

int main(void) {
    cin >> N >> K;
    if ((N - 1) * (N - 2) / 2 < K) {
        cout << -1 << endl;
        return 0;
    }

    int cnt = 0;
    int cur = (N - 1) * (N - 2) / 2;
    FOR(i, 1, N) {
        ans[cnt++] = {0, i};
    }
    FOR(i, 1, N) {
        if (cur == K) break;
        FOR(j, 1, N) {
            if (cur == K) break;
            if (j + i >= N) break;

            ans[cnt++] = {j, j + i};
            cur--;
        }
    }

    printf("%d\n", cnt);
    REP(i, cnt) printf("%d %d\n", ans[i].first + 1, ans[i].second + 1);
}


Measured memory_bytes: 256
from collections import Counter

N = int(input())
numbers = list(map(int, input().split()))
counter = Counter(numbers)

num_pairs = sum(
  (v * (v - 1)) // 2
  for v in counter.values()
)

for k in numbers:
  v = counter[k]
  print(num_pairs - (v * (v - 1)) // 2 + ((v - 1) * (v - 2)) // 2)
  

Measured memory_bytes: 87884
#include<stdio.h>
int main()
{
  char s[11];
  int t,i,k[11],v=0,tmp,j;
  k[0]=0;
  k[1]=0;
  k[2]=0;
  k[3]=0;
  k[4]=0;
  scanf("%s",s);
  for(i=0;s[i]!='\0';i++)
  {
    if(s[i]=='A'||s[i]=='T'||s[i]=='G'||s[i]=='C')
    {
      if(k[v]==0)
      {

        k[v]++;
        t=i;
      }
      else
      {
        if(t==i-k[v])
        {
          k[v]++;
        }
        else
        {
          v++;
          k[v]++;
          t=i;
        }
      }
          
    }
  }
  for(i=0;i<v+1;i++)
  {
    for(j=1;j<v+1;j++)
    {
      if(k[j-1]<k[j])
      {
        tmp=k[j-1];
        k[j-1]=k[j];
        k[j]=tmp;
      }
    }
  }
  printf("%d\n",k[0]);
  return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <cstdint>
#include <vector>
#include <algorithm>

int main() {
  size_t N, C;
  scanf("%zu %zu", &N, &C);

  std::vector<std::vector<int>> D(C, std::vector<int>(C));
  for (auto& di: D)
    for (auto& dij: di)
      scanf("%d", &dij);

  std::vector<std::vector<int>> c(N, std::vector<int>(N));
  for (auto& ci: c)
    for (auto& cij: ci)
      scanf("%d", &cij);

  std::vector<std::vector<int>> g(3);
  for (size_t i = 0; i < N; ++i)
    for (size_t j = 0; j < N; ++j)
      g[(i+j) % 3].push_back(c[i][j]);

  std::vector<std::vector<int>> d(3, std::vector<int>(C));
  for (size_t i = 0; i < 3; ++i)
    for (size_t j = 0; j < C; ++j)
      for (size_t k = 0; k < g[i].size(); ++k)
        d[i][j] += D[g[i][k]-1][j];

  int res = 1e9;
  for (size_t i = 0; i < C; ++i)
    for (size_t j = 0; j < C; ++j) {
      if (j == i) continue;
      for (size_t k = 0; k < C; ++k) {
        if (k == i || k == j) continue;
        res = std::min(res, d[0][i]+d[1][j]+d[2][k]);
      }
    }

  printf("%d\n", res);
}


Measured memory_bytes: 2668
// problem: "https://atcoder.jp/contests/abc152/tasks/abc152_a"

#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,m;
    cin>>n>>m;

    if(n == m)
        cout<<"Yes";

    else
        cout<<"No";

    return 0;
}


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

string S, T;
void input() {
  cin >> S >> T;
}

void solve() {
T.pop_back();
  if(S == T) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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


Measured memory_bytes: 3628
kn=input().rstrip().split(" ")
k=int(kn[0])
n=int(kn[1])
numbers=input().rstrip().split(" ")
ans=0
for i in range(n-1):
    delta=int(numbers[i+1])-int(numbers[i])
    if delta>=ans:
        ans=delta
lasdelta=int(numbers[0])+k-int(numbers[n-1])
if lasdelta>=ans:
    ans=lasdelta
#print(ans)
print(k-ans)

Measured memory_bytes: 18356
fun main() {
    println(if (next() == "ABC") "ARC" else "ABC")
}

val sc = java.util.Scanner(System.`in`)
fun next() = sc.next()!!
fun nextInt() = sc.nextInt()
fun next2Int() = Pair(nextInt(), nextInt())
fun next3Int() = Triple(nextInt(), nextInt(), nextInt())
fun nextIntArray(size: Int) = IntArray(size) { nextInt() }
fun nextLong() = sc.nextLong()
fun nextLine() = sc.nextLine()!!
fun nextList() = nextLine().split(" ")
fun printYesNo(isYes: Boolean) = println(if (isYes) "Yes" else "No")
fun printString(action: StringBuilder.() -> Unit) = println(buildString(action))


Measured memory_bytes: 36348
#include <iostream>
#include <algorithm>

using namespace std;

int main(){
    long N;
    cin >> N;
    long ans = 0;
    ans = (1 + N) * N / 2;
    ans -= 3 * (1 + N / 3) * (N / 3) /2 + 5 * (1 + N / 5) * (N / 5) /2 - 15 * (1 + N / 15) * (N / 15) / 2;
    cout << ans << endl;
    return 0;
}

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

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		List<long> candi = new List<long>();
		for(long i=1;i<=999;i++) candi.Add(i);
		
		long keta = 10;
		long shimo = 9;
		
		for(long l=4;l<17;l++){
			for(long i=100;i<=999;i++){
				candi.Add(i * keta + shimo);
			}
			keta *= 10;
			shimo *= 10;
			shimo += 9;
		}
		
		int N = candi.Count;
		bool[] snuke = new bool[N];
		//double min = candi[N-1] / (double) candi[N-1].ToString().Select(c => c - '0').Sum();
		long minn = candi[N-1];
		long mind = candi[N-1].ToString().Select(c => c - '0').Sum();
		
		for(int i=N-2;i>=0;i--){
/*			double v = candi[i] / (double) candi[i].ToString().Select(c => c - '0').Sum();
			
			if(v <= min){
				snuke[i] = true;
				min = v;
			}
*/
			long vn = candi[i];
			long vd = candi[i].ToString().Select(c => c - '0').Sum();
			if(vn * mind <= minn * vd){
				snuke[i] = true;
				minn = vn; mind = vd;
			}
			
			
		}
		
		List<long> ans = new List<long>();
		for(int i=0;ans.Count < K;i++){
			if(!snuke[i]) continue;
			ans.Add(candi[i]);
		}
		
		Console.WriteLine(String.Join("\n",ans));
	}
	int K;
	public Sol(){
		K = ri();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


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

int main( void )
{
  string s, t;
  cin >> s >> t;
  int size;
  bool large = false;
  int count = 0;
  sort( s.begin(), s.end() );
  sort( t.begin(), t.end() ,greater<int>() );

  if( s.size() > t.size() )
    size = t.size();
  else
    size = s.size();
  
  for( int i = 0; i < size; i++ ) {
    if( s.at( i ) < t.at( i ) ) {
      large = true;
      break;
    }
    else if( s.at( i ) > t.at( i ) ) {
      large = false;
      break;
    }
    count++;
  }

  if( count == size ) {
    if( s.size() >= t.size() )
      large = false;
    else
      large = true;
  }
    
 
    

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

Measured memory_bytes: 3628
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
import sys
from collections import deque, defaultdict, Counter; from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bisect_right, insort_left, insort_right
from operator import itemgetter as ig
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20; INF = float("INF"); ans = 0; tmp = 0; ansli = []; tmpli = []; candili = []
eps = 1.0 / 10 ** 10; mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]; ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]; ddn9 = ddn + [(0, 0)]
"""for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:"""
def wi(): return list(map(int, sys.stdin.readline().split()))
def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]#WideIntPoint
def ws(): return sys.stdin.readline().split()
def i(): return int(sys.stdin.readline())
def s(): return input()
def s_list(): return list(input())
def hi(n): return [i() for _ in range(n)]
def hs(n): return [s() for _ in range(n)]#HeightString
def mi(n): return [wi() for _ in range(n)]#MatrixInt
def num__grid(n): return [[int(i) for i in sys.stdin.readline().split()[0]] for _ in range(n)]#NumberGrid
def mip(n): return [wip() for _ in range(n)]
def ms(n): return [ws() for _ in range(n)]
def grid(n): return [s_list() for _ in range(n)]

s = s()
for moji in range(4):
    cnt = 0
    for i in range(4):
        if s[moji] == s[i]:
            cnt += 1
    if cnt != 2:
        print("No")
        exit()
print("Yes")

Measured memory_bytes: 6480
#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111; 
using namespace std;
using lint = long long;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int H, W;
	cin >> H >> W;

	vector<string> grid(H);
	int black = 0;
	for (int i = 0; i < H; i++) {
		cin >> grid[i];
		for (int j = 0; j < W; j++) black += grid[i][j] == '#';
	}

	vector<vector<int>> used(H, vector<int>(W, INF));
	used[0][0] = 1;
	vector<int> dx{ 1,0,-1,0 }, dy{ 0,1,0,-1 };

	auto ok = [&](int x, int y) { return 0 <= x && x < H && 0 <= y && y < W && grid[x][y] == '.'; };

	auto dfs = [&](auto &&f, int x, int y) -> bool {
		
		bool flag = (x == H - 1 && y == W - 1);

		for (int i = 0; i < 4; i++) {
			int xto = x + dx[i], yto = y + dy[i];
			if (ok(xto, yto) && used[xto][yto] > used[x][y] + 1) {
				used[xto][yto] = used[x][y] + 1;
				flag |= f(f, x + dx[i], y + dy[i]);
			}
		}

		return flag;

	};

	if(dfs(dfs,0,0)) cout << H * W - black - used.back().back() << "\n";
	else cout << "-1\n";

	return 0;
}

Measured memory_bytes: 384
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const ll MAX_E = 200001;

struct uf_tree {
  vector<ll> par, sizes;
  uf_tree(ll n) : par(n), sizes(n, 1) {
    for (ll i = 0; i < n; i++) {
      par[i] = i;
    }
  }
  ll find(ll x) {
    if (x == par[x]) {
      return x;
    }
    return par[x] = find(par[x]);
  }
  void unite(ll x, ll y) {
    x = find(x);
    y = find(y);
    if (x == y) {
      return;
    }
    if (sizes[x] < sizes[y]) {
      swap(x, y);
    }
    par[y] = x;
    sizes[x] += sizes[y];
  }
  bool same(ll x, ll y) { return find(x) == find(y); }
  ll size(ll x) { return sizes[find(x)]; }
};

struct edge {
  ll u, v, cost;
};
bool comp(const edge &e1, const edge &e2) { return e1.cost < e2.cost; }

edge es[MAX_E];
ll V, E;

ll kruskal() {
  sort(es, es + E, comp);
  uf_tree uf(V);
  ll res = 0;
  for (ll i = 0; i < E; i++) {
    edge e = es[i];
    if (!uf.same(e.u, e.v)) {
      uf.unite(e.u, e.v);
      res += e.cost;
    }
  }
  return res;
}

ll N;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  V = N;
  E = 2 * (N - 1);
  vector<pair<long, long>> x(N), y(N);
  for (int i = 0; i < N; i++) {
    long xi, yi;
    cin >> xi >> yi;
    x[i] = make_pair(xi, i);
    y[i] = make_pair(yi, i);
  }
  sort(x.begin(), x.end());
  sort(y.begin(), y.end());
  for (int i = 1; i < N; i++) {
    es[i - 1] =
        edge{x[i - 1].second, x[i].second, abs(x[i].first - x[i - 1].first)};
  }
  for (int i = 1; i < N; i++) {
    es[i - 2 + N] =
        edge{y[i - 1].second, y[i].second, abs(y[i].first - y[i - 1].first)};
  }

  cout << kruskal() << endl;
  return 0;
}

Measured memory_bytes: 9600
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define forever while (true)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
template<typename A> using V = std::vector<A>;
template<typename A> using F = std::function<A>;
template<typename A, typename B> using P = std::pair<A, B>;
using pii = P<int, int>;
using vi = V<int>;
using vd = V<double>;
using vs = V<std::string>;
using vpii = V<pii>;
using vvi = V<vi>;
using vvpii = V<vpii>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
template<typename T> std::istream &operator>>(std::istream &is, std::vector<T> &v) { for (T &x : v) is >> x; return is; }
using namespace std;
// clang-format on

main {
  int h, w;
  vs v;
  while (cin >> h >> w, h) {
    rep(_, h) cout << string(w, '#') << endl;
    cout << endl;
  }
}

Measured memory_bytes: 3168
#include <bits/stdc++.h>
using namespace std;
int main() {
  int A,B;
  cin >> A >> B;
  int num=0;
  for(int i=A; i<B+1; i++){
    int a =i/10000;
    int e =i%10;
    int b =i/1000-a*10;
    int d =(i%100-e)/10;
  if(a==e && b==d){
     num++;}
}
    cout << num <<endl;
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)

ll N;

void solve_sub(ll max_char, const string& s){
    if(s.size() == N){
        cout << s << endl;
        return;
    }

    for(ll i = 0; i <= max_char + 1; ++i){
        char c = 'a' + static_cast<char>(i);
        solve_sub(max(max_char, i), s + c);
    }
}

int main(){
    cin >> N;
    solve_sub(-1, "");
    return 0;
}


Measured memory_bytes: 1536
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		// 奇数の時L
		// 偶数の時R
		// No出力
		Scanner sc = new Scanner(System.in);
		String[] s = sc.nextLine().split("");
		int size = s.length;
		for (int i = 0; i < size; i++) {
			if (i % 2 == 0) {
				if ("L".equals(s[i])) {
					System.out.println("No");
					return;
				}
			} else {
				if ("R".equals(s[i])) {
					System.out.println("No");
					return;
				}
			}
		}
		System.out.println("Yes");
	}
}


Measured memory_bytes: 23764
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <deque>
#include <iterator>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
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;}

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;

ll modpow(ll x, ll p) {
  if (p==0) return 1LL;
  if (p==1) return x;
  ll tmpp = modpow(x, p/2);
  if (p&1) return (tmpp*tmpp%MOD)*x%MOD;
  else return tmpp*tmpp%MOD;
}

int main() {
  ll n; cin >> n;
  vll a(n); REP(i, n) cin >> a[i];
  sort(a.begin(), a.end());
  if (n&1) {
    if (a[0] != 0) {cout << 0 << endl; return 0;}
    else {
      for (ll i=1; i<n; i+=2) {
        if (a[i] != (i+1)/2*2 || a[i] != a[i+1]) {
          cout << 0 << endl; return 0;
        }
      }
      cout << modpow(2, (n-1)/2) << endl;
    }
  } else {
    for (ll i=0; i<n; i+=2) {
      if (a[i] != i+1 || a[i] != a[i+1]) {
        cout << 0 << endl; return 0;
      }
    }
    cout << modpow(2, n/2) << endl;
  }
  return 0;
}


Measured memory_bytes: 1024
N,M = map(int, input().split())

tpls = []
for i in range(N):
    a,b = map(int, input().split())
    tpls.append((a, b))
tpls.sort()
need = 0
now = 0
idx = 0
while now < M:
    a, b = tpls[idx]
    if now + b > M:
        need += a * (M - now)
        now = M
    else:
        need += a*b
        now += b
    idx += 1
print(need)

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

using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (int i=(int)from; i<(int)to; i++)
#define all(vec) vec.begin(), vec.end()
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (int i=(int)N-1; i>=0; i--)

const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;

vector<ll> fac;
void c_fac(int x=pow(10,6)+10) { fac.resize(x,true); rep(i,x) fac[i] = i ? (fac[i-1]*i)%MOD : 1; }
ll inv(ll a, ll m=MOD) { ll b = m, x = 1, y = 0; while (b!=0) { int d = a/b; a -= b*d; swap(a,b); x -= y*d; swap(x,y); } return (x+m)%m; }
ll nck(ll n, ll k) { return fac[n]*inv(fac[k]*fac[n-k]%MOD)%MOD; }
ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }


int main() {
  string T; cin >> T;
  ll N = T.size();
  vector<ll> seq1; ll now = 0, c1 = 0; 
  rep(i,N) { 
    if (T[i]=='0') { seq1.push_back(now); now = 0; }
    else { now++; c1++; }
  }
  seq1.push_back(now);

  ll e1 = 0; for (auto &x: seq1) { e1 += x/2; x %= 2; }
  vector<ll> seq0; now = 0;
  for (auto x: seq1) {
    if (x==0) now++;
    else { seq0.push_back(now); now = 1; }
  }
  seq0.push_back(now-1);
  // debug(all(seq1)); debug(all(seq0));

  ll sl = seq0.size();
  ll sum[sl] = {}, rsum[sl] = {};
  rep(i,sl) sum[i] = i==0 ? seq0[i] : sum[i-1] + 1 + seq0[i];
  per(i,sl) rsum[i] = i==sl-1 ? 0 : rsum[i+1] + seq0[i+1];
  // debug(sum,sum+sl); debug(rsum,rsum+sl);

  ll result = 0;
  rep(i,sl-1) {
    result += (N-(c1-1)) - ((sum[i]+1)/2-i/2);
    // cout << (N-(c1-1)) - (sum[i]/2-i/2) << endl;
  }

  rep(i,c1-1) result += i/2+1;
  result += e1 * (N-(c1-1));
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 6516
N = int(input())
xyh = [list(map(int, input().split())) for _ in range(N)]
xyh.sort(key = lambda x: -x[2])
H = 0
for i in range(101):
  for j in range(101):
    for l in xyh:
      h = abs(i - l[0]) + abs(j - l[1])
      if l[2] != 0:
        if H == 0:
          H = l[2] + h
        else:
          if l[2] + h != H:
            H = 0
            break
      else:
        if H != 0:
          if H - h > 0:
            H = 0
            break
            
    if H != 0:
      print(i, j, H)
      exit(0)

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

int main()
{
    int i, j, count=0;

    string s;
    cin>>s;

    for(i=0; i<4; i++)
    {
        int sum=0;
        for(j=0; j<4; j++)
        {
            if(s[i] == s[j])
                sum++;
        }
        if(sum != 2)
        {
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes";


    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using p=pair<int,int>;
#define int long long
#define rep(i,N) for(int i=0;i<N;i++)

signed main(){
  int A,B;
  cin>>A>>B;
  if(A!=1&&B!=1)cout<<1;
  if(A!=2&&B!=2)cout<<2;
  if(A!=3&&B!=3)cout<<3;
}

Measured memory_bytes: 256
def main(k,a,b):
    for i in range(a,b+1):
        if i%k == 0:
            return print('OK')
    return print('NG')

if __name__=='__main__':
    k = int(input())
    a,b = list(map(int,input().split()))
    main(k,a,b)


Measured memory_bytes: 9172
n = int(input())
s = input()

max_score = 0
for i in range(1,n-1):
    s1 = s[:i]
    s2 = s[i:]
    dic = []

    for x in s1:
        if x in s2 and x not in dic:
            dic.append(x)

    if max_score < len(dic):
        max_score = len(dic)

print(max_score)


Measured memory_bytes: 3060
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cmath>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <fstream>
#include <list>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cassert>
#include <ctime>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:16777216")
#define _DEBUG
#define vec vector
#define pb push_back
#define en '\n'
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<ll, ll> pull;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef long double ld;
typedef unsigned int ui;
typedef map<int,int> mii;
typedef map<ll,ll> mll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> vi2;
typedef vector<vector<ll>> vll2;
typedef vector<vector<ll>> matrix;
typedef vec<vec<vec<int>>> vi3;

#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:16777216")
#define pb push_back
#define en '\n'
#define for0(i,n) for(int i = 0;i<n;i++)
#define for1(i,n) for(int i = 1;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define vec vector
#define pii pair<int,int>
#define pll pair<ll,ll>
#define REP(a,i,b) for (int i = a;i<b;i++);

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

const int inf = 2e9;
const ll linf = 5000000000000000000;
const ld LDINF = 2e18;
template<typename T> void print(vector<T>& a)
{
    for (int i = 0; i < a.size(); i++)
        cout << a[i] << ' ';
    cout << en;
}

template<typename T> void print(deque<T>& a)
{
    for (int i = 0; i < a.size(); i++)
        cout << a[i] << ' ';
    cout << en;
}

template<typename T> void print(vector<vector<T>>& a)
{
    for (int i = 0; i < a.size(); i++)
    {
        for (int j = 0; j < a[i].size(); j++)
            cout << a[i][j];
        cout << en;
    }
}

template <typename T> void input(vector<T>& a)
{
    for (int i = 0; i < a.size(); i++)
        cin >> a[i];
}

template<typename T> void input(deque<T>& a)
{
    for (int i = 0; i < a.size(); i++)
        cin >> a[i];
}

template<typename T> void input(vector<vector<T>>& a)
{
    for (int i = 0; i < a.size(); i++)
        for (int j = 0; j < a[i].size(); j++)
            cin >> a[i][j];
}

ll mod = 998244353;


void solve(){
    string str;
    cin >> str;
    int ch = str.back() - '0';
    if(ch == 3)
        cout << "bon";
    else if(ch == 0 || ch == 1 || ch == 6 || ch == 8)
        cout << "pon";
    else
        cout << "hon";
    
}




int main()
{
    
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
#ifdef DEBUG
    freopen("input.txt", "r", stdin);
    //  freopen("output.txt", "w", stdout);
#endif
    int tst = 1;
   // cin >> tst;
    while(tst--)
        solve();
    
}


Measured memory_bytes: 3600
import sys
s = sys.stdin.readline()
ans = 0
for i in range(len(s)):
    # print(f'{s[i]=}')
    if s[i] not in {'A', 'C', 'G', 'T'}: continue
    length = 1
    for j in range(i + 1, len(s)):
        if s[j] in {'A', 'C', 'G', 'T'}:
            # print(f'{s[j]=}')
            length += 1
        else: break
    ans = max(ans, length)
    # print(f'{ans=}')
print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<bitset>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define rep(i,n) for(i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define INF INT_MAX
#define vi vector<int>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define vvc vector<vector<char> >
#define vvs vector<vector<string> >
#define P 1000000007
using namespace std;
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 LLINF=1LL<<60;
//set<int>::iterator it;
//|\_
//g++ -std=c++1z temp.cpp
//./a.out





int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
    int i,n,t,y;
    cin>>n;
    vector<int> v(n,0);
    rep(i,n){
        cin>>t;
        y=0;
        while(t%2==0){
            t/=2;
            y++;
        }
        v[i]=y;
    }
    sort(v.begin(),v.end());
    cout<<v[0]<<endl;
    
//////////////////////////////////////////////////////
return 0;}


Measured memory_bytes: 256
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let x = read::<String>()
        .chars()
        .map(|x| x.to_digit(10).unwrap() as i32)
        .collect::<Vec<_>>();
    for i in 0..1 << 3 {
        let mut coef = vec![1; 3];
        for j in 0..3 {
            if i >> j & 1 == 1 {
                coef[j] = -1;
            }
        }
        if x[0] + coef[0] * x[1] + coef[1] * x[2] + coef[2] * x[3] == 7 {
            let mut ans = vec![std::char::from_digit(x[0] as u32, 10).unwrap()];
            if coef[0] == 1 {
                ans.push('+');
            } else {
                ans.push('-');
            }
            ans.push(std::char::from_digit(x[1] as u32, 10).unwrap());
            if coef[1] == 1 {
                ans.push('+');
            } else {
                ans.push('-');
            }
            ans.push(std::char::from_digit(x[2] as u32, 10).unwrap());
            if coef[2] == 1 {
                ans.push('+');
            } else {
                ans.push('-');
            }
            ans.push(std::char::from_digit(x[3] as u32, 10).unwrap());
            ans.push('=');
            ans.push('7');
            let ans = ans.into_iter().collect::<String>();
            println!("{}", ans);
            return;
        }
    }
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main()
{
    int n;cin>>n;
    string s[n] ;
    int t[n];
    int ans=0;
    for(int i=0;i<n;++i)
    cin>>s[i]>>t[i];
    bool fg=false;
    string tp;
    cin>>tp;
    for(int i=0;i<n;++i){
        if(fg)
        ans+=t[i];
        if(s[i]==tp)
        fg=true;
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 256
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define reps(i,a,b) for(int i=a;i<b;++i)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<typename T> inline bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U &u,const V... v){for(auto &e:u)fill_v<T>(e,v...);}

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

    int x;
    cin >> x;
    for (int i = 1; i <= 1000; ++i) {
        if ((360 * i) % x == 0) {
            cout << (360 * i) / x << endl;
            return 0;
        }
    }
}


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

int main(){
	
	long long n, tmp;
	
	cin >> n;
	
	long long ans = n-1;
	
	for (long long i = 1; i*i <= n; i++){
		if (n % i == 0){
			tmp = i + n/i - 2;
			ans = min(ans, tmp);
		}
	}
	
	cout << ans;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<utility>
#include<array>
#include<cassert>
#include<list>
#include<experimental/any>
#include<cstring>
#include<cctype>
#include<ctime>
#include<cstdbool>
#include<cstdint>
#include<cstddef>
#include<set>
#include<unordered_set>
#include<bitset>

using namespace std;
using experimental::any;

#define SPEEDY cin.tie(0);ios::sync_with_stdio(false);

#define REP(i,n) for(int i=0;i<(n);i++)
#define ARREP(i,n,X) for(int i=0;i<(n);i++)cin>>X[i]
#define FOR(i,X,n) for(int i=(X);i<(n);i++)
#define EREP(i,n) for(int i=1;i<=n;i++)

#define MODE 0
#define DEB(X) if(MODE)cout<< #X <<": "<<X<<" ";
#define DEB2(X) if(MODE)cout<<X<<" ";
#define ARDEB(i,X) if(MODE)cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define TFDEB(f) if(MODE){(f)? cout<<"true ":cout<<"false ";}
#define FORDEB(n,X) if(MODE)for(int i=0;i<(n);i++)ARDEB(i,X)
#define END if(MODE)cout<<endl;

typedef long long int ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
#define ALL(X) X.begin(),X.end()
struct edge{int to,cost;};
struct P2{int x,y;};
//struct edge{int from,cost,to;};
#define Endl endl

const int MOD7=1000000007;
const int INF=100000000;
const int SET=1000;

int main(){
	int a[31][100001]={},n,m,count=0,max=0;
	cin>>n>>m;
	REP(i,n){
		int s,t,c;
		cin>>s>>t>>c;
		a[c-1][s-1]++,a[c-1][t]--;
	}
	REP(i,30){//シミュレーション
		REP(j,100000){
			a[i][j+1]+=a[i][j];
		}
	}
	REP(i,100001){
		count=0;
		REP(j,30){
			if(a[j][i]>0){
				count++;
			}
		}
		if(count>max){
			max=count;
		}
	}
	cout<<max<<endl;
	return 0;
}

Measured memory_bytes: 12416