akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <limits.h>

int main(int argc, char *argv[])
{
    long long x;
    scanf("%lld", &x);

    switch( x%11 ){
    case 0:
        printf("%lld\n", (x/11)*2);
        break;
    case 1: case 2: case 3: case 4: case 5: case 6:
        printf("%lld\n", (x/11)*2+1);
        break;
    case 7: case 8: case 9: case 10:
        printf("%lld\n", (x/11)*2+2);
        break;
    }
    return 0;
}

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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    ll N, K; cin >> N >> K;
    if(K == 0){
        cout << N*N << endl;
        return;
    }
    ll res = 0;
    Rep1(i, K+1, N){
        res += (N/i)*(i-K);
        if(N%i >= K) res += (N%i - (K-1));
    }

    cout << res << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    int x,n; cin>>x>>n;
    vector<ll> p(n);
    set<int> st;
    rep(i,n) {
        cin>>p[i];
        st.insert(p[i]);
    }
    sort(p.begin(), p.end());
    
    int ans = INF;
    int idx = 0;
    for (int i = -10; i < 110; ++i) {
        if (st.count(i)) continue;
        if (chmin(ans, abs(i-x))) idx = i;
    }

    cout << idx << '\n';
    return 0;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
 
using namespace std;
using pint = pair<int, int>;
 
double dist(pint xyi, pint xyj) {
	double ans;
	ans = sqrt(pow(xyi.first - xyj.first, 2) + pow(xyi.second - xyj.second, 2));
	return ans;
}
 
int main(){
	int N;
	cin >> N;
	vector<pint> xy(N);
	for (int i = 0; i < N; i++) {
		cin >> xy[i].first;
		cin >> xy[i].second;
	}
 
	vector<int> order(N);
	for (int i = 0; i < N; i++) order[i] = i;
 
	double dist_sum = 0;
	int count = 0;
 
	do {
		for (int i = 1; i < N; i++) {
			dist_sum += dist(xy[order[i - 1]], xy[order[i]]);
		}
		count++;
	} while (next_permutation(order.begin(), order.end()));
 
	double dist_avg = dist_sum / count;
 
	cout << fixed << setprecision(6) << dist_avg << endl;
 
	return 0;
}

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

using namespace std;


int main() {
    int n;
    cin >> n;
    for(int i = 1; i <= n; i++) {
        int ans = 0;
        for(int j = 1; j <= 100; j++) {
            for(int k = 1; k <= 100; k++) {
                int rest = i - j * j - k * k - j * k;
                int a = -1 * (k + j) + sqrt((k + j) * (k + j) + 4 * rest);
                int b = -1 * (k + j) - sqrt((k + j) * (k + j) + 4 * rest);
                a /= 2; b /= 2;
                if(j * j + k * k + a * a + j * k + k * a + a * j == i) {
                    if(j > 0 && k > 0 && a > 0) {
                        ans++;
                    }
                }
                if(j * j + k * k + b * b + j * k + k * b + b * j == i) {
                    if(j > 0 && k > 0 && b > 0) {
                        ans++;
                    }
                }
            }
        }
        cout << ans << "\n";
    }
    return 0;
}

Measured memory_bytes: 3532
// ALDS1_4_C.cpp
// Search - Dictionary

#include <iostream>
#include <set>
using namespace std;

int main()
{
    int n = 0;
    cin >> n;
    string cmd;
    string str;
    set<string> dict;
    while (n--) {
        cin >> cmd >> str;
        if (cmd == "insert") {
            dict.insert(str);
        }
        else if (cmd == "find") {
            set<string>::iterator it = dict.find(str);
            if (it != dict.end()) cout << "yes" << endl;
            else cout << "no" << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 32632
#include<iostream>
#include<cmath>
#include<string>
#include<algorithm>
#include <iomanip> 
using namespace std;
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    string str; int n,i; 
    while (cin >> n >> str)
    {
        int ans = 0;
        for (i = 0; i < n-2; i++)
        {
            if (str[i] == 'A')
                if (str[i + 1] == 'B')
                    if (str[i + 2] == 'C')
                        ans++;
        }
        cout << ans << '\n';
    }

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
const long long INF = 1LL << 60;

int main() {
  long long N, M; cin>>N>>M;
  vector<pair<long long, long long>> drinks;
  for(long long i=0; i<N; i++){
    long long A, B; cin>>A>>B;
    drinks.push_back(make_pair(A, B));
  }
    sort(drinks.begin(), drinks.end());
    long long sum=0;
    for(auto x:drinks){
      if(M>0){
        sum+=x.first*min(M,x.second);
        M=M-min(M,x.second);
    } //if
  } //for
    cout<<sum<<endl;
}


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

class Program
{
    static void Main()
    {
        Console.WriteLine(Solve());
        return;
    }

    public static string Solve()
    {
        int N = ReadInt();
        int a = 0;
        int b = 0;
        int ba = 0;
        long cnt = 0;
        for (int i = 0; i < N; i++)
        {
            string str = Read();
            for (int j = 0; j < str.Length - 1; j++)
            {
                if (str[j] == 'A' && str[j + 1] == 'B')
                {
                    j++;
                    cnt++;
                }
            }
            if (str[0] == 'B')
            {
                if (str[str.Length - 1] == 'A')
                {
                    ba++;
                }
                else
                {
                    b++;
                }
            }
            else
            {
                if (str[str.Length - 1] == 'A')
                {
                    a++;
                }
            }
        }
        if (ba > 0)
        {
            cnt += ba - 1;
            if (a > 0)
            {
                a--;
                cnt++;
            }
            if (b > 0)
            {
                b--;
                cnt++;
            }
        }
        cnt += Math.Min(a, b);
        return cnt.ToString();
    }

    private static string Read() { return Console.ReadLine(); }
    private static int ReadInt() { return int.Parse(Read()); }
    private static long ReadLong() { return long.Parse(Read()); }
    private static double ReadDouble() { return double.Parse(Read()); }
    private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
    private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
    private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
}


Measured memory_bytes: 13140
import sys
def input():
    return sys.stdin.readline()[:-1]

N, M = map(int, input().split())
L = []
for i in range(N):
    l, r = map(int, input().split())
    L.append((r - l + 1, l, r + 1))
L.sort()


class Bit:
    """
    0-indexed
    # 使用例
    bit = Bit(10)  # 要素数
    bit.add(2, 10)
    print(bit.sum(5))  # 10
    """

    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)

    def sum(self, i):
        # [0, i) の要素の総和を返す
        if not (0 <= i <= self.size): raise ValueError("error!")
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        if not (0 <= i < self.size): raise ValueError("error!")
        i += 1
        while i <= self.size:
            self.tree[i] += x
            i += i & -i


class BitImos:
    """
    ・範囲すべての要素に加算
    ・ひとつの値を取得
    の2種類のクエリをO(logn)で処理
    """

    def __init__(self, n):
        self.bit = Bit(n + 1)

    def add(self, s, t, x):
        # [s, t)にxを加算
        self.bit.add(s, x)
        self.bit.add(t, -x)

    def get(self, i):
        return self[i]

    def __getitem__(self, key):
        # 位置iの値を取得
        return self.bit.sum(key + 1)


imos = BitImos(M + 1)
il = 0
a = N
A = [0] * M
for i in range(1, M + 1):
    while il < N:
        ra, l, r = L[il]
        if i < ra:
            break
        il += 1
        a -= 1
        imos.add(l, r, 1)
    ans = 0
    for j in range(i, M + 1, i):
        ans += imos[j]

    A[i - 1] = ans + a

print(*A, sep="\n")


Measured memory_bytes: 105180
import java.util.List;
import java.util.Scanner;
import java.util.function.LongSupplier;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class Main{
	static final Scanner s=new Scanner(System.in);
	static final long[] fal_rnd(long[] ar,LongSupplier sp){
		int l=-1,r=ar.length;
		while(l+1!=r)
			ar[Math.random()<0.5?++l:--r]=sp.getAsLong();
		return ar;
	}
	static final IntStream REPS(int v){
		return IntStream.range(0,v);
	};
	public static void main(String[] __){
		int n,r;
		while((n=s.nextInt())+(r=s.nextInt())!=0){
			List<Integer> l=IntStream.rangeClosed(1,n).mapToObj(Integer::valueOf).collect(Collectors.toList());
			for(int i=0;i<r;i++) {
				final int p=s.nextInt(),c=s.nextInt();
				l.addAll(l.subList(n-p-c+1,n-p+1));
				l.subList(n-p-c+1,n-p+1).clear();;
			}
			System.out.println(l.get(l.size()-1));
		}
	}
}

Measured memory_bytes: 40836
import collections

def get_input():
    return list(map(lambda x:int(x), input().split()))

def main():
    inp = get_input()
    n, m = inp[0], inp[1]
    adj_list = [[] for i in range(n)]
    for i in range(m):
        inpu = get_input()
        a, b = inpu[0], inpu[1]
        adj_list[a - 1].append(b - 1)
        adj_list[b - 1].append(a - 1)
    
    q = collections.deque()
    visited = set()
    q.append(0)
    visited.add(0)
    p = [-1] * n

    #print(adj_list)
    while q:
        u = q.popleft()
        for i in adj_list[u]:
            #print("checking", u, i)
            if i not in visited:
                q.append(i)
                visited.add(i)
                p[i] = u
    #print(p)
    
    for i in range(1, len(p)):
        if p[i] == -1:
            print("No")
            return

    print("Yes")
    for i in range(1, n):
        print(p[i] + 1)

if __name__ == '__main__':
    main()

Measured memory_bytes: 40252
using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        Scanner.Read();
        var inputs = Scanner.ReadInts();

        var max = inputs.Max();
        Console.WriteLine(inputs.Aggregate((a, b) => a + b) - 2 * max > 0 ? "Yes" : "No");
    }
}




public class Scanner
{
    public static string Read() { return Console.ReadLine(); }
    public static int ReadInt() { return int.Parse(Console.ReadLine()); }
    public static double ReadDouble() { return double.Parse(Console.ReadLine()); }

    public static string[] ReadStrs() { return Console.ReadLine().Split(' '); }
    public static int[] ReadInts() { return Console.ReadLine().Split(' ').Select(_ => int.Parse(_)).ToArray(); }
    public static double[] ReadDoubles() { return Console.ReadLine().Split(' ').Select(_ => double.Parse(_)).ToArray(); }

}

Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;

int n;
map<string, int> mp;

int main(){
  cin >> n;
  rep(i, n){
    string s; cin >> s;
    sort(s.begin(), s.end());
    mp[s]++;
  }
  long long res = 0;
  for(pair<string, int> x : mp){
    long long num = (long)x.second;
    num = (num * (num - 1)) / 2;
    res += num;
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 11136
#include<iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>

using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define loop(i,a,b) for(int (i)=(a);(i)<(b);++(i))
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))

typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;


int main(void){
  int n, t;
  cin>>n>>t;
  int ret = 1e9;
  rep(i,n){
    int a,b;
    cin>>a>>b;
    if(b <= t){
      ret = min(ret,a);
    }
  }
  if(ret == 1e9){
    cout<<"TLE"<<endl;
  } else {
    cout<<ret<<endl;
  }
}



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

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

     // Recording "number of 1" and "number of 0" alternately
     vector < int > nums;
     if (S [ 0 ] == '0' ) nums.push_back ( 0 ); // If the beginning is 0
     for ( int i = 0 ; i <S.size ();) {
         int j = i;
         while (j <S.size () && S[j] == S[i]) ++ j; // How far does the value of S [i] continue?
         nums.push_back (j-i);
         i = j;
     }
     if (S.back () == '0' ) nums.push_back ( 0 ); // If the last is 0

     // Cumulative sum
     vector < int > sums (( int ) nums.size () + 1 , 0 );
     for ( int i = 0 ; i <nums.size (); ++ i) sums [i + 1 ] = sums [i] + nums [i];

     // Find the maximum value of the sum of the interval of length 2K + 1 (or less) starting from the even index
     int res = 0 ;
     for ( int left = 0 ; left <sums.size (); left+= 2 ) {
         int right = left + K * 2 + 1 ;
         if (right >= sums.size ()) right = ( int ) sums.size () -1 ;
         res = max (res, sums [right]-sums [left]);
     }
     cout << res << endl;
 }


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

int main()
{
  int N;
  cin >> N;
  vector<ll> L(N+1);

  for(int i=0; i<=N; ++i) {
    if(i==0) L[i] = 2;
    else if(i==1) L[i] = 1;
    else L[i] = L[i-2]+L[i-1];
  }
  cout << L[N] << endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include<math.h>
using namespace std;

int main(){
	int n,maximum,sum;
	while(true){
		scanf("%d",&n);
		if(n == 0)break;

		int array[n];
		for(int i=0;i<n;i++)scanf("%d",&array[i]);
		maximum = -600000000;
		for(int k=0;k<n;k++){//?§????????????????
			sum = 0;
			for(int p=k;p<=n-1;p++){	//??????????????????
				sum += array[p];
				maximum = (maximum >= sum)? maximum:sum;
			}
		}
		printf("%d\n",maximum);
	}

    return 0;
}

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

class Program
{
    static void Main(string[] args)
    {
        List<int> inp1 = (new List<string>(Console.ReadLine().Split(' '))).ConvertAll(x => int.Parse(x));
        List<int> inp2 = (new List<string>(Console.ReadLine().Split(' '))).ConvertAll(x => int.Parse(x));

        int pos = 0;
        int cnt=1;
        foreach (int n in inp2) {
            pos += n;
            if (pos > inp1[1])
                break;
            cnt++;
        }
        Console.WriteLine(cnt);
    }
}


Measured memory_bytes: 13268
#include<bits/stdc++.h>
using namespace std;
int ar[100];
int main(){
	int n;cin>>n;
  	for(int i=1;i<=n;i++){
    	cin>>ar[i];
    }
  	int ans = 0;
  	for(int i=1;i<=n;i++){
    	for(int j=i+1;j<=n;j++){
        	ans += ar[i]*ar[j];
        }
    }
  	cout<<ans;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>

int main(){
	for(int i = 0; i < 3; ++i){
		std::string str;
		std::cin >> str;
		std::cout << static_cast<char>(str[0] + ('A' - 'a'));
	}
	std::cout << std::endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
#define rep(i, n) for(int i=0;i<n;i++)

  
int main(){
 ll n;
  cin >> n ;
  if(n>=1000) cout << "ABD"  <<endl;
  else cout <<"ABC" << endl;
}
  

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<queue>
#define lli long long
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(),i.rend()
#define rep0(i,j) for(int i=0;i<j;i++)
#define rep1(i,j) for(int i=1;i<=j;i++)
#define rep0d(i,j) for(int i=j-1;i>=0;i--)
#define MAX 1000000007

using namespace std;

bool cmpf(const pair<lli, lli> left, const pair<lli, lli> right) {
	return left.first < right.first;
}
bool cmps(const pair<lli, lli> left, const pair<lli, lli> right) {
	return left.second < right.second;
}
using namespace std;
lli n, m, p;



int main() {
	string s;
	lli a, b;
	cin >> a >> b;

	rep0(i, 2 * a - 1) {
		
		cout << b - a + 1 + i << ' ';
	}
}

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

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

constexpr int atcoder_mod = 1e9+7;

using namespace std;
using ll = long long;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

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

	int N=in();
	auto X=vecin(N);
	auto Y=vecin(N);

	double sum = 0;
	REP(i,N){
		sum += abs(X[i]-Y[i]);
	}
	printf("%.10lf\n",sum);

	sum = 0;
	REP(i,N){
		sum += pow(X[i]-Y[i],2);
	}
	printf("%.10lf\n",sqrt(sum));

	sum = 0;
	REP(i,N){
		sum += pow(abs(X[i]-Y[i]),3);
	}
	printf("%.10lf\n",pow(sum,1.0/3.0));
		
	sum = 0;
	REP(i,N){
		sum = max(sum,(double)abs(X[i]-Y[i]));
	}
	printf("%.10lf\n",sum);

	return 0;
}



Measured memory_bytes: 3328
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
//#include <utility>
//#include <memory>
//#include <functional>
//#include <deque>
//#include <cctype>
//#include <ctime>
//#include <numeric>
//#include <list>
//#include <iomanip>

//#if __cplusplus >= 201103L
//#include <array>
//#include <tuple>
//#include <initializer_list>
//#include <forward_list>
//
//#define cauto const auto&
//#else

//#endif

using namespace std;


typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	int n,a,b;
	cin>>n>>a>>b;
	string s;
	cin>>s;
	int aa = 0;
	int bb = 0;
	rep(i,s.size()){
		if(s[i] == 'c'){
			cout<<"No"<<endl;
		}
		else if(s[i] == 'a'){
			if(aa+bb < a+b){
				cout<<"Yes"<<endl;
				aa++;
			}
			else{
				cout<<"No"<<endl;
			}
		}
		else{
			if(aa+bb < a+b && bb < b){
				cout<<"Yes"<<endl;
				bb++;
			}
			else{
				cout<<"No"<<endl;
			}
		}
	}
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(20);
    mainmain();
}

Measured memory_bytes: 976
using System;
using System.Collections.Generic;

namespace ATCoder
{
    class Program
    {
        static void Main( string[] args )
        {
            var list = new List<string>();
            var input = Console.ReadLine();
            string[] token = input.Split( ' ' );
            string a = token[ 0 ];
            string b = token[ 1 ];

            string str_a = ConvertStr( a , int.Parse( b ) );
            string str_b = ConvertStr( b , int.Parse( a ) );
            list.Add(str_a);
            list.Add(str_b);
            list.Sort();

            Console.WriteLine(list[0]);
        }

        static string ConvertStr(string str, int num)
        {
            string ret = "";

            for(int i = 0 ;i < num ;i++ )
            {
                ret += str;
            }

            return ret;
        }
    }
}


Measured memory_bytes: 11360
import sys
import collections

stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

N, P = rl()
answer = 1
A = prime_factorize(P)
c = collections.Counter(A)
for k, v in c.items():
    if v >= N:
        answer *= k ** (v//N)
print(answer)
#03


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

int main(){
    while(true){
        int n, w, h;
        int x, y;
        int s, t;
        int field[100][100];
        int mxcnt=0;
        cin >> n;
        if(!n) break;
        cin >> w >> h;
        for(int i=0;i<w;++i){
            for(int j=0;j<h;++j){
                field[i][j]=0;
            }
        }
        for(int i=0;i<n;++i){
            cin >> x >> y;
            field[x-1][y-1]=1;
        }
        cin >> s >> t;
        for(int i=0;i<w-s+1;++i){
            for(int j=0;j<h-t+1;++j){
                int cnt=0;
                for(int k=0;k<s;++k){
                    for(int l=0;l<t;++l){
                        cnt += field[i+k][j+l];
                    }
                }
                mxcnt = max(mxcnt, cnt);
            }
        }
        cout << mxcnt << endl;
    }
}

Measured memory_bytes: 1200
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define PF push_front
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double
#define pii pair<int,int>
#define pll pair<LL,LL>
#define vi vector<int>
#define vl vector<LL>
#define vii vector<vi>
#define vll vector<vl>

const double pi = 3.14159265358979323846264;
const int mod=1000000007;

int main(){
	string s;
    cin>>s;
    if(s[0]>='a'&&s[0]<='z'){
        cout<<"a";
    }else{
        cout<<"A";
    }
}


Measured memory_bytes: 3596
use std::io;
use std::str::FromStr;

fn main() {
    let mut line = String::new();
    io::stdin().read_line(&mut line).unwrap();
    let split : Vec<&str> = line.split(' ').collect();
    let a : i64 = i64::from_str(split[0].trim()).unwrap();
    let b : i64 = i64::from_str(split[1].trim()).unwrap();

    println!("{}", if same_month(a, b) { "Yes" } else { "No" })
}

fn same_month(a: i64, b: i64) -> bool {
    return match a {
        1 | 3 | 5 | 7 | 8 | 10 | 12 => b == 1 || b == 3 || b == 5 || b == 7 || b == 8 || b == 10 || b == 12,
        4 | 6 | 9 | 11 => b == 4 || b == 6 || b == 9 || b == 11,
        2 => b == 2,
        _ => false
    }
}


Measured memory_bytes: 4352
package main

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

func main() {
	var n, m int
	fmt.Scan(&n, &m)

	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)


	l := make([]int, m)
	r := make([]int, m)
	upper := n
	lower := 0
	for i := 0; i < m; i++ {
		sc.Scan()
		l[i], _ = strconv.Atoi(sc.Text())
		sc.Scan()
		r[i], _ = strconv.Atoi(sc.Text())

		if lower < l[i] {
			lower = l[i]
		}
		if upper > r[i] {
			upper = r[i]
		}
	}
	
	if upper < lower {
		fmt.Println(0)
		return
	}

	fmt.Println(upper - lower + 1)
}


Measured memory_bytes: 4572
n = int(input())
ns = list(map(int,input().split()))
c = 0
for i in range(n-1):
    for j in range(n-1-i):
        if ns[j] > ns[j+1]:
            ns[j],ns[j+1]=ns[j+1],ns[j]
            c+=1
print(" ".join(map(str,ns)))
print(c)


Measured memory_bytes: 5600
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional> //operator[]
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;

signed main(){
    string s; cin >> s;
    if(s.size()%2==1){
        cout << "No" << endl;
        return 0;
    }
    rep(i,s.size()){
        if(i%2==0){
            if(s[i]!='h'){
                cout << "No" << endl;
                return 0;
            }
        }else{
            if(s[i]!='i'){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
}


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

int main(){
    ll n,k,c;
    cin >> n >> k >> c;
    string s,s2,s3;
    cin >> s;
    s2=s;

    ll r=1001001;
    ll wt=0;
    vector <int> a(n),b(n+c,0),d(n);
    rep(i,n){
        s3=s[i];
        if(s3=="o" and r>=c){
            r=0;
            ++wt;
            a[i]=wt;
        }
        else{
            a[i]=wt;
            ++r;
        }
        d[i]=c-min(c,r);
        if(d[i]==0){
            d[i]=1;
        }
    }

    r=1001001;
    wt=0;
    rep(i,n){
        s3=s[n-i-1];
        if(s3=="o" and r>=c){
            r=0;
            ++wt;
            b[n-i-1]=wt;
        }
        else{
            b[n-i-1]=wt;
            ++r;
        }
    }

    /*rep(i,n){
        cout << a[i] << " " << b[i] << " " << d[i] << endl;    
        }*/


    vector <ll> ans;
    rep(i,n){
        if(i==0){
            if(b[1]<k){
                ans.push_back(i+1);
            }
        }
        else{
            if((a[i-1]+b[i+d[i-1]])<k){
                ans.push_back(i+1);
            }
        }
    }

    int l;
    l=ans.size();

    rep(i,l){
        cout << ans[i] << endl;
    }



    

    return 0;
}

Measured memory_bytes: 7980
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
/*=付けてなかった。上のがないから気付かなかったけど確かにないとダメそう。便利だし毎回使おう*/
using ll = long long;
 
int main() {
  ll n;
  cin >> n;
  string ans;
  while(n){
    n--; //0スタートにしたいから
    /*charとint混ぜて書けるのすごい。余り分aより上げたやつ入れられる。ASCIIコードかな。
    分からなくて26通り場合分けしたの頭悪そう*/
    ans += 'a'+n%26;
    n /= 26;
  }
  reverse(ans.begin(),ans.end()); //逆順で入れてるからひっくり返すの忘れずに
  cout << ans << endl;
}
/*
  下から埋めるっていう発想がなかったな。手で計算する時上からだし
  1000000000000001が最大何桁の文字列になるのか調べちゃった名残説もある
  reverse知らなくて思い付けなくて上から埋めるしかないってなっちゃったのもある
  上から埋めるだと、割って商入れて余りを一桁分小さい数でまた割って商入れて最後の桁は余りを入れるってなって
  最初に桁数調べなきゃいけなくて面倒くさいし、場合分け分かりづらいしし実装混乱した
  ずっと商入れてって最後だけ余りみたいな書き方してたから二桁までしかAC出来なかったのかな
  でもなんでダメだったのかよく分からない
  
  26で割った余り入れる→nを26で割った商にすることで一桁分下げる、を繰り返すイメージ
  めちゃ短くて感動
  
  下から埋めてくから、何文字の文字列になるか調べてその文字数分for文、とかなくていい。
  n!=0の間whileすれば、必要な桁まで出したら勝手に終わる
  同様にその文字数の文字列たちの中で何番目かとかも気にしなくていい
  while(n)はwhile(n!=0)と同じ意味
  */

Measured memory_bytes: 3588
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,n) for(int i = (a); i < (n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define debug_v(v,N) for(int i=0;i<N;i++) { cout << v[i] << " "; } cout << endl;
#define debug_vv(v,H,W) for(int i=0;i<H;i++) { for(int j=0;j<W;j++) { cout << v[i][j] << " "; } cout << endl; }

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;

void Main()
{
	string S; cin >> S;
	map<char, int> mp;
	rep(i, S.length()) {
		mp[S[i]] += 1;
	}
	for (auto pair : mp) {
		if (pair.second % 2 != 0) {
			cout << "No" << endl;
			return;
		}
	}
	cout << "Yes" << endl;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
}


Measured memory_bytes: 256
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }
int nmax=200000; // 2*(10^5)
vvec g(nmax);



signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    int n;
    cin>>n;
    vector<int> a(n);
    REP(i,n) cin >> a[i];
    sort(all(a));
    if(a[n-1]-a[0]>1){
        cout<<"No"<<endl;
        return 0;
    }
    int cnt0=0,cnt1=0;
    rep(i,n){
        if(a[i]-a[0]==0) cnt0++;
        else cnt1++;
    }

    if(a[0]==a[n-1]){
        if(n==a[0]+1){
            cout<<"Yes"<<endl;
        }
        else if(n>=a[0]*2){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }
    else{
        if(cnt0+1==a[n-1]){
            cout<<"Yes"<<endl;
        }
        else if(cnt0+1>a[n-1]){
            cout<<"No"<<endl;
        }
        else if(cnt1>=2*(a[n-1]-cnt0)&&(a[n-1]-cnt0)>=0){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }
}

Measured memory_bytes: 5760
#include<stdio.h>

int main(){
	int n,x,j=200000,i,m[100],ans;
	scanf("%d%d",&n,&x);
	ans=n;
	for(i=0;i<n;i++){
		scanf("%d",&m[i]);
		x-=m[i];
	}
	for(i=0;i<n;i++){
		if(m[i]<j)j=m[i];
	}
	for(i=0;;i++){
		if(x-j>=0){
			x-=j;
			ans++;
		}else break;
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main(){
    // Your code here!
    string A;
    cin >> A;
    int count=0;
    for(int j=0;j<A.size()/2;j++){
        if(A.at(j)!=A.at(A.size()-j-1)){
            count++;
        }
    }
    cout<<count<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <numeric>
using namespace std;
#define ll long long
#define mod  1000000007
#define rep(i, n) for (int i = 0; i < n; ++i)
using Graph = vector<vector<int>>;
#define grepq priority_queue<double, std::vector<double>, std::greater<double>>
#define all(v) v.begin(),v.end()
#define PI acos(-1)

const ll INF = 10010001010;
const int inf = 2000000000;
ll lcm(ll a, ll b)
{
    return a * b / __gcd(a, b);
}

typedef tuple<string, int, int> TUP;

bool tuplesort(const TUP &right, const TUP &left)
{
    if (get<0>(right) != get<0>(left))
    {
        return get<0>(left) < get<0>(right);
    }
    if (get<1>(left) != get<1>(right))
    {
        return get<1>(left) > get<1>(right);
    }
    return get<2>(left) < get<2>(right);
}
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};


ll nCr(int n, int r)
{
    ll ans = 1;
    for (int i = n; i > n - r; --i)
    {
        ans = ans * i;
    }
    for (int i = 1; i < r + 1; ++i)
    {
        ans = ans / i;
    }
    return ans;
}

int main(){
    int N;
    cin >> N;
    ll ans = 0;
    map<string, int> M;
    for (int i = 0; i < N; i++)
    {
        string s;
        cin >> s;
        sort(all(s));
        M[s]++;
        ans += M[s] - 1;
    }

    cout << ans << endl;
}

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

bool compare_by_b(pair<long long,long long> a, pair<long long,long long> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}





int main(void){
    int N;
    cin >> N;
    long long A,B;
    vector<pair<long long,long long>>AB;
    
    for(int i = 0; i < N ; i++){
        cin >> A >> B;
        AB.push_back(make_pair(A,B));
    }
    sort(AB.begin(),AB.end(), compare_by_b);
    
    
    long long sum = 0;
    for(int i = 0; i < N ; i++){
        sum += AB[i].first;
        if(sum > AB[i].second){
            cout <<"No"<<endl;
            return 0;
        }
        
    }
    
    cout <<"Yes"<<endl;
    
}


Measured memory_bytes: 6512
inputted = list(map(int, input().split()))
K = inputted[0]
N = inputted[1]
A = list(map(int, input().split()))

distancies = []
for i, Ai in enumerate(A):
    current = i
    to = (i + 1) % len(A)
    distance = A[to] - A[current] if i < len(A) - 1 else K - A[current] + A[0]
    distancies.append(distance)

answer = K - max(distancies)

print(answer)


Measured memory_bytes: 26444
N = int(input())
f = [list(map(int, input().split())) for _ in range(N)]
p = [list(map(int, input().split())) for _ in range(N)]

ans = -float('inf')
for i in range(1, 2**10):
    t = [1 if i & (1 << j) != 0 else 0 for j in range(10)]
    b = 0
    for j in range(N):
        c = 0
        for k in range(10):
            if t[k] == 1 and f[j][k] == 1:
                c += 1
        b += p[j][c]
    ans = max(ans, b)
print(ans)


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

using namespace std;

int main() {
  int N;
  cin >> N;
  
  int v[N + 2];
  for (int i = 0; i < N; i++) {
    cin >> v[i+1];
  }
  
  vector<int> dp(N+1, 0);
  dp[2] = abs(v[2] - v[1]);
  
  for (int i = 2; i < N; i++) {
    dp[i+1] = min(dp[i] + abs(v[i+1] - v[i]), dp[i-1] + abs(v[i+1] - v[i-1]));
  }
  
  cout << dp[N] << endl;
  
  
}

Measured memory_bytes: 1024
//A
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	string a,b;
	cin >> a >> b;
	for(int i = 0;i < a.size();i++){
		if(a[i] != b[i] or a.size() != b.size()-1){
			cout << "No";
			return 0;
		}
	}
	cout << "Yes";
	return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>
#include <numeric>
#include <string.h>
#include <sys/time.h>
#include <random>


#define fs first
#define sc second

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;


int main(){
    int N;
    string s;
    cin >> N;
    cin >> s;

    if(N % 2 == 1){
        cout << "No" << endl;
        return 0;
    }
    bool res = true;
    for(int i = 0; i < N / 2; i++){
        if(s[i] == s[i + N / 2]){
            continue;
        }
        else {
            res = false;
        }
    }

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

    return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int dp[1000000];
int rec(int i, int n, int *arr)
{
    if (n < 2)
    {
        return 0;
    }
    else if (i == 0)
    {
        dp[0] = 0;
        dp[1] = abs(arr[0] - arr[1]);
        rec(i + 2, n, arr);
    }
    else
    {

        if (i < n)
        {
            int temp = dp[i - 2] + abs(arr[i - 2] - arr[i]);
            int temp1 = dp[i - 1] + abs(arr[i - 1] - arr[i]);
            dp[i] = min(temp, temp1);

            rec(i + 1, n, arr);
        }
    }
    return dp[n - 1];
}

int main()
{
    int n;
    cin >> n;
    int arr[n];
    for (int i = 0; i < n; i++)
    {
        cin >> arr[i];
    }
    cout << rec(0, n, arr) << endl;
}

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

int main(){
	int n,x;
	cin>>n>>x;
	//n = n+1;
	int s =0;
	int l,ans,cnt=1;
	while(n--){
		cin>>l;
		ans = s+l;
		s= ans;
		if(ans<=x)
			cnt++;
		else
			break;
	}
	cout<<cnt;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define sz(v)   ((int)(v).size())
#define  all(v)    ((v).begin()),((v).end())
#define  allr(v)    ((v).rbegin()),((v).rend())
#define   pb         push_back
#define   mp         make_pair
#define    clr(v,d)      memset( v, d ,sizeof(v))
typedef  long long     ll ;
typedef  unsigned long long ull;
const double EPS= (1e-9);
using namespace std;
int getBit(int num, int idx) {return ((num >> idx) & 1) == 1;}
int setBit1(int num, int idx) {return num | (1<<idx);}
ll setBit0(ll num, int idx) {return num & ~(1ll<<idx);}
ll flipBit(int num, int idx) {return num ^ (1<<idx);}
void GO(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);}
const int N=0;

int main(){
    GO();

    int n;
    cin>>n;
    int d1= n%10;
    n/=10;
    int d2=n%10;
    n/=10;
    int d3=n%10;

    if(d1==7||d2==7||d3==7){
        cout<<"Yes\n";
    }
    else{
        cout<<"No\n";

    }
}




























Measured memory_bytes: 3624
#include<iostream>
#include<math.h>
#include<string>
#include<iomanip>
#include <limits>
#include<stdlib.h>
#include<algorithm>
using namespace std;

int main()
{
std::string s; std::getline(cin,s);
std::replace(s.begin(), s.end(),',', ' ');
cout<<s;
}


Measured memory_bytes: 3632
public class Main {
    public static void main(String args[]) {
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int H = sc.nextInt();
        int W = sc.nextInt();
        int d[][] = new int[10][10];
        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                d[i][j] = sc.nextInt();
            }
        }
        for (int k = 0; k < 10; k++) {
            for (int i = 0; i < 10; i++ ) {
                for (int j = 0; j < 10; j++) {
                    d[i][j] = Math.min(d[i][j], d[i][k] + d[k][j]);
                }
            }
        }
        
        int ans = 0;
        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                int tmp = sc.nextInt();
                if (tmp != -1) ans += d[tmp][1];
            }
        }
        System.out.println(ans);
    }
}

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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

int main() {
	int n = ri(), range = ri() * 2 + 1;
	int bomb = ri();
	std::pair<int, int> a[n];
	for (int i = 0; i < n; i++) a[i].first = ri(), a[i].second = ri();
	std::sort(a, a + n);
	
	int head[n];
	for (int i = 0; i < n; i++) head[i] = std::lower_bound(a, a + n, a[i].first + range, [] (auto i, int j) { return i.first < j; }) - a;
	
	int64_t imos[n + 1];
	memset(imos, 0, sizeof(imos));
	int64_t res = 0;
	for (int i = 0; i < n; i++) {
		if (i) imos[i] += imos[i - 1];
		int64_t cur = a[i].second > imos[i] ? (a[i].second - imos[i] - 1) / bomb + 1 : 0;
		res += cur;
		imos[i] += cur * bomb;
		imos[head[i]] -= cur * bomb;
	}
	std::cout << res << std::endl;
	
	return 0;
}



Measured memory_bytes: 4096
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

k = int(read())
n = 50
a = [n - 1] * n
x, y = divmod(k, n)
for i in range(n):
    a[i] += x - y
    if i < y:
        a[i] += n + 1
print(n)
print(*a)


Measured memory_bytes: 3060
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
#include <map>
#include <set>
#include <queue>
#include <math.h>
#include <algorithm>

using namespace std;

char buf[1001][1001];
int dbuf[1001][1001];

struct info
{
  int x, y, d;
  info(int _x, int _y, int _d) : x(_x), y(_y), d(_d) {}
};

int main()
{
  int H, W;
  cin >> H >> W;
  for (int i=0;i<H;i++) {
    cin >> buf[i];
  }
  for (int i=0;i<H;i++)
    for (int j=0;j<W;j++)
      dbuf[i][j] = __INT_MAX__;
  int dx[] = {-1, 0, 1, 0};
  int dy[] = {0, 1, 0, -1};
  queue<info> q;
  for (int y=0;y<H;y++) {
    for (int x=0;x<W;x++) {
      if (buf[y][x] == '#') {
        q.push(info(x, y, 0));
        dbuf[y][x] = 0;
      }
    }
  }
  while (!q.empty()) {
    info cur = q.front();
    q.pop();
    for (int i=0;i<4;i++) {
      int nx = cur.x+dx[i];
      int ny = cur.y+dy[i];
      int nd = cur.d+1;
      if (nx < 0 || nx >= W || ny < 0 || ny >= H) continue;
      if (buf[ny][nx] == '.' && dbuf[ny][nx] > nd) {
        dbuf[ny][nx] = nd;
        q.push(info(nx, ny, nd));
      }
    }
  }
  int maxD = 0;
  for (int y=0;y<H;y++) {
    for (int x=0;x<W;x++) {
      if (maxD < dbuf[y][x]) maxD = dbuf[y][x];
    }
  }
  cout << maxD << endl;
  return 0;
}


Measured memory_bytes: 17296
#include <stdio.h>
int c;
void search(int i,int j,int s)
{
  if(10-i < j || i > s) return;
  if(j == 1){
    if(s < 10 && i <= s) c++;
    else return;
  }else{
    search(i+1,j-1,s-i);
    search(i+1,j,s);
  }
}
int main()
{
  int n,s;
  for(;;){
    scanf("%d%d",&n,&s);
    if(n==0&&s==0) break;
    c = 0;
    search(0,n,s);
    printf("%d\n",c);
  }
  return 0;
}

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

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 1000000007;
//const int MOD = 998244353;
//const long long int MOD = 998244353;

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

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	cin >> N >> M >> K;
	for (int i = 1; i <= 10; i++) {
		K *= N;
		K -= M;
		cout << K << endl;
	}
}


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

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repr(i,n) for (int i = 0; i < (f); --i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

const int MAX = 100;
const int INF = (1<<12);

int main() {
  long h, w;
  cin >> h >> w;
  long ans;
  if(h == 1 || w == 1){
    cout << 1 << endl;
  }else{
    ans = h * w / 2;
    if ((h * w) % 2 == 1) ans++; 
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 256
# B
s = str(input())
max_len = 0
for i in range(len(s)):
    for j in range(i, len(s)+1):
        a = s[i:j]
        a_l = list(a)
        ACGT = True
        for c in a_l:
            if c == 'A' or c == 'C' or c == 'G' or c == 'T':
                continue
            else:
                ACGT = False
                break
        if ACGT:
            if max_len < len(a):
                max_len = len(a)
print(max_len)

Measured memory_bytes: 3060