akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int main(){
    char mi='z'+1;
    vector< bool > app(26,false);
    string str;
    cin>>str;
    for(int i=0;i<str.size();++i){
        app[str[i]-'a']=true;
    }
    for(int i=0;i<26;++i){
        if(!app[i]&&mi=='z'+1){
            mi=i+'a';
            break;
        }
    }
    if(mi!='z'+1) printf("%c\n",mi);
    else printf("None\n");
    return 0;
}



Measured memory_bytes: 512
#include <bits/stdc++.h>
#include<vector>
#include<set>
#define ll long long
using namespace std;
  
int main() {
	
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll t,a,b,c,d=0,n,m,k,sum=1,i,j;
       string str;
    cin>>str;
    n=str.size();
    for(i=0,j=n-1;i<j;i++,j--)
    {
    	if(str[i]!=str[j])
    	{
    		cout<<"No\n";
    		return 0;
		}
	}
	cout<<"Yes\n";
	
    
  return 0;
}


Measured memory_bytes: 3616
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;
const int maxn = 200010;
const int lo = 20;
const int off = 1 << lo;
const int siz = off * 2;
const long long inf = (1LL << 50);

int n, m;
int a[maxn], b[maxn], c[maxn];
long long dp[maxn];
long long tour[siz], prop[siz];
//long long niz[maxn];
vector< pair<long long, int> > niz[maxn];

void send(int node) {
     tour[node * 2] += prop[node], tour[node * 2 + 1] += prop[node];
     prop[node * 2] += prop[node], prop[node * 2 + 1] += prop[node];
     prop[node] = 0;
}

void update(int a, int b, int x, int y, int node, long long val) {
     /**
     for (int i = a; i <= b; i++)
         tour[i] += val;
     **/
     
     if (x > b || y < a) return;
     if (x >= a && y <= b) {
         tour[node] += val;
         prop[node] += val;
         //if (node >= off)
         return;
     } 
     
     send(node);
     int mid = (x + y) / 2;
     update(a, b, x, mid, node * 2, val);
     update(a, b, mid + 1, y, node * 2 + 1, val);
     tour[node] = max(tour[node * 2], tour[node * 2 + 1]);
}

long long query(int a, int b, int x, int y, int node) {
     /**
     long long sol = -inf;
     for (int i = a; i <= b; i++)
         sol = max(tour[i], sol);
     return sol;
     **/
     
     if (x > b || y < a) return -inf;
     if (x >= a && y <= b) return tour[node];
     
     send(node);
     int mid = (x + y) / 2;
     return max(query(a, b, x, mid, node * 2), query(a, b, mid + 1, y, node * 2 + 1));
}

int main() {
    scanf("%d%d", &n, &m);
    for (int i = 0; i < m; i++)
        scanf("%d%d%d", a+i, b+i, c+i);
        
    for (int i = 0; i < m; i++) {
        niz[a[i]].push_back(make_pair(c[i], a[i] - 1));
        niz[b[i] + 1].push_back(make_pair(-c[i], a[i] - 1));
    }
    
    for (int i = 1; i <= n; i++) {
        for (int j = 0; j < niz[i].size(); j++)
            update(0, niz[i][j].second, 0, off - 1, 1, niz[i][j].first);
        dp[i] = query(0, i - 1, 0, off - 1, 1);
        update(i, i, 0, off - 1, 1, dp[i]);
        //for (int i = 0; i <= n; i++) printf("%d ", tour[i]); printf("\n");
    }
    //printf("debug: "); for (int i = 1; i <= n; i++) printf("%d ", dp[i]); printf("\n");
    printf("%lld\n", *max_element(dp, dp+n+1));
    //system("pause");
    return 0;   
}


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

typedef long long ll;
typedef long double ld;

int n, x, t;

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


Measured memory_bytes: 3640
#include <iostream>
using namespace std;
int main(void){
    string n,x;
    cin >> n;
    x = n[n.size()-1];
    if(x=="3") cout << "bon";
    else if(x=="0" or x=="1" or x=="6" or x=="8") cout << "pon";
    else cout << "hon";

}

Measured memory_bytes: 3580
#include <stdio.h>

int rev(int n)
{
	int out;

//printf("(%d ", n);
	
	out = 0;
	
	while (n > 0){
		out = out * 10 + (n % 10);
		n /= 10;
	}

//printf("%d)", out);
	
	return (out);
}


int main(void)
{
	int n;
	int i;
	
	scanf("%d", &n);
	
	i = 0;
	
	while (1){
		if (n - i >= 0){
			if (rev(n - i) == n - i){
				printf("%d\n", n - i);
				break;
			}
		}
		if (rev(n + i) == n + i){
			printf("%d\n", n + i);
			break;
		}
		i++;
	}
	
	return (0);
}

Measured memory_bytes: 596
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int n=s.size(),x=0,y=0;
  for(int i=0;i<n;i++){
    if(i%2==1){
      if(s[i]=='0')
        x++;
      else
        y++;
    }
    else{
      if(s[i]=='0')
        y++;
      else
        x++;
    }
  }
  cout << min(x,y) << endl;
  //cout << x << ' ' << y << endl;
}

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

using ll = long long;
using P = pair<ll, int>;

int main() {
    using star = tuple<int, ll, ll>;
    int N, d;
    cin >> N >> d;
    vector<star> v(N);
    for(int i=0; i<N; ++i) {
        int b;
        ll x, y;
        cin >> x >> y >> b;
        v[i] = make_tuple(b, x, y);
    }
    sort(v.begin(), v.end());

    ll res = 0;
    priority_queue<P> ma_x, ma_y;
    priority_queue<P, vector<P>, greater<P>> mi_x, mi_y;
    int l = 0, r = 0;
    while(true) {
        while(r < N && get<0>(v[r]) - get<0>(v[l]) <= d) {
            ma_x.push(P{get<1>(v[r]), r});
            ma_y.push(P{get<2>(v[r]), r});
            mi_x.push(P{get<1>(v[r]), r});
            mi_y.push(P{get<2>(v[r]), r});
            r++;
        }
        while(!ma_x.empty() && ma_x.top().second < l) {
            ma_x.pop();
        }
        while(!ma_y.empty() && ma_y.top().second < l) {
            ma_y.pop();
        }
        while(!mi_x.empty() && mi_x.top().second < l) {
            mi_x.pop();
        }
        while(!mi_y.empty() && mi_y.top().second < l) {
            mi_y.pop();
        }
        res = max(res, (ma_x.top().first - mi_x.top().first) * (ma_y.top().first - mi_y.top().first));

        if(r == N) {
            break;
        }
        l++;
    }
    cout << res << endl;
}


Measured memory_bytes: 20216
#include <bits/stdc++.h>
#define INF 5000000000000000000
#define ll long long
#define pll pair<ll, ll>
using namespace std;

ll M, B;
bool init = false;
vector<pair<ll, ll>> MB = {{2147483647, 2147483634}, {2147483629, 2147483627}, {2147483587, 2147483583}, {2147483579, 2147483576}, {2147483563, 2147483550}, {2147483543, 2147483541}, {2147483497, 2147483492}, {2147483489, 2147483486}, {2147483477, 2147483475}};

//=============rolling_hash============================
vector<bool> rolling_hash(string a, string b) {
  if (!init) {
    init = true;
    random_device rnd;
    mt19937 mt(rnd());
    uniform_int_distribution<> rand9(0, 8);
    ll temp = rand9(mt);
    M = MB.at(temp).first;
    B = MB.at(temp).second;
  }
  ll al = a.size(), bl = b.size();
  vector<bool> res(al, false);
  ll t = 1;
  ll ah = 0, bh = 0;
  for (ll i = 0; i < bl; ++i) {
    ah = (ah * B + a.at(i)) % M;
    bh = (bh * B + b.at(i)) % M;
    t = (t * B) % M;
  }
  for (ll i = 0; i < al; ++i) {
    if (ah == bh) {
      res.at(i) = true;
    }
    ah = (ah * B + a.at((i + bl) % al)) % M;
    ah -= (a.at(i) * t) % M;
    if (ah < 0ll) {
      ah += M;
    }
    ah %= M;
  }
  return res;
}
//=================================================

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string s, t;
  cin >> s >> t;
  string s_ = s;
  while (s.size() < t.size()) {
    s += s_;
  }
  vector<bool> ps = rolling_hash(s, t);
  ll N = ps.size();
  ll ans = 0;
  vector<bool> used(N, false);
  for (ll i = 0; i < N; ++i) {
    if (ps.at(i) && !used.at(i)) {
      ll cnt = 1;
      ll now = i;
      while (true) {
        now = (now + t.size()) % N;
        if (used.at(now)) {
          cout << -1 << "\n";
          return 0;
        }
        if (!ps.at(now)) {
          break;
        }
        used.at(now) = true;
        cnt += 1;
      }
      now = i;
      while (true) {
        now -= t.size();
        if (now < 0) {
          now += N;
        }
        now %= N;
        if (used.at(now)) {
          cout << -1 << "\n";
          return 0;
        }
        if (!ps.at(now)) {
          break;
        }
        used.at(now) = true;
        cnt += 1;
      }
      ans = max(ans, cnt);
    }
  }
  cout << ans << "\n";
  // for (ll i = 0; i < ps.size(); ++i) {
  //   if (ps.at(i)) {
  //     cout << '1';
  //   }
  //   else {
  //     cout << '0';
  //   }
  // }
  // cout << "\n";
}


Measured memory_bytes: 6756
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String t = sc.next();
		
		char[] sChar = s.toCharArray();
		char[] tChar = t.toCharArray();
		int diff = 0;
		for (int i = 0; i < s.length(); i++) {
			if(s.charAt(i) != t.charAt(i)) {
				diff++;
			}
		}
		System.out.println(diff);
	}

}


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

int main() {
  int A,B,T,ans=0; cin >> A >> B >> T;
  if(A>T) {
    cout << 0 << endl;
    return 0;
  }
  else {
    while(T>=A) {
      ans += B;
      T -= A;
    }
  }
  cout << ans << endl;
}

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

const int black = 48;
const int white = 49;

int main(){
    string S;
    cin >> S;
    int N = S.length();


    int ans_w = 0;
    for (int i = 0; i < N; ++i){
        int _01 = (i%2 == 0 ? white : black);
        if (S[i] != _01){
            ans_w++;
        }
    }

    int ans_b = 0;
    for (int i = 0; i < N; ++i){
        int _01 = (i%2 == 0 ? black : white);
        if (S[i] != _01){
            ans_b++;
        }
    }

    cout << min(ans_b, ans_w) << endl;

}

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

int main(){
    int n;
    cin >> n;
    vector<int> s(n);
    int ans = 0;
    rep(i, n) {
        cin >> s[i];
        ans += s[i];
    }
    sort(all(s));
    if (ans%10==0) {
        rep(i, n) {
            int tmp = ans - s[i];
            if (tmp%10!=0) {
                ans = tmp;
                break;
            }
        }
        if (ans%10==0) ans = 0;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <functional>
#include <iostream>
#include <algorithm>

using namespace std;

int main(int argc, char *argv[])
{
  long long n;
  cin >> n;

  long long a[n*3];
  for (long long i = 0; i < n*3; ++i) {
    cin >> a[i];
  }

  sort(a, a+n*3);

  long long total = 0;


  for (long long i = n; i < n*3; i+=2) {
    total += a[i];
  }

  cout << total << endl;
}

Measured memory_bytes: 2560
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 23 21:42:28 2019

@author: Yamazaki Kenichi
"""
import sys

N = int(input())
B = list(map(int,input().split()))

for i in range(N):
    if B[i] > i+1:
        print(-1)
        sys.exit()
ans = []
def a(B):
    for i in range(1,len(B)+1):
        if B[-i] == len(B)+1-i:
            ans.append(B[-i])
#            print(i,B)
            del B[-i]
            a(B)
            return
a(B)
ans.reverse()
for c in ans:
    print(c)
        

Measured memory_bytes: 3064
#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <deque>
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#include <fstream>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define all(c) begin(c),end(c)
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
void print(vec v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(vecll v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(map<int,int> mp){for(auto e:mp)cout<<e.first<<" "<<e.second<<endl;cout<<endl;}


#define INF 1e9+7
#define LLINF 1e18+7
const ll MOD=1e9+7;
const int N=500000;

main(){
    int n;cin>>n;
    vecll a;
    rep(i,n)a.pb(in());
    ll sum=0;
    rep(i,n)sum+=a[i];
    ll tmp=0;
    ll ans=LLINF;
    rep(i,n){
        tmp+=a[i];
        ll res=sum-tmp;
        if(res>=tmp){
            ans=min(ans,res-tmp);
        }
        else{
            if(tmp-res<a[i])ans=min(ans,tmp-res);
        }
    }
    cout<<ans;
}

Measured memory_bytes: 2420
#include <bits/stdc++.h>
#define lli long long int
#define pb push_back
#define mod 1000000007
#pragma GCC optimize ("-O3")
#define mod2 998244353
#define MAXN 1000000000
#define v32 vector<int>
#define v64 vector<lli>
#define v1024 vector <vector <int>>
#define v4096 vector <vector <lli>>
#define vt vector
#define f(x, y, z) for (lli x = y; x < z; x++)
#define fd(x, y, z) for (lli x = y; x > z; x--)
#define lb lower_bound
#define ld long double
#define m64 map<lli,lli>
#define m32 map<int,int>
#define m64it map<lli,lli>::iterator
#define m32it map<int,int>::iterator
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ist insert
#define endl "\n"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define p_q priority_queue 
#define min_p_q priority_queue <int,vt <int>,greater <int>>
using namespace std;
using namespace __gnu_pbds; 
template <typename T> 
void DEBUG_ARR(vt<T> a,char c)
{
	f(i,0,a.size())cout<<a[i]<<c;
	cout<<"\n";
}

lli tmod(lli x,lli m){return (x%m+m)%m;}//USE AT YOUR OWN RISK
lli power(lli x, lli y) 
{
    lli res = 1;  
   
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x)%mod; 
        y = y>>1; 
        x = (x*x)%mod;  
    }
    if(res<0)
       res+=mod; 
    return res; 
}

int main() 
{ 
    fastio;
    string s;
    cin>>s;
    f(i,0,s.size())cout<<"x";
    return 0; 	
}


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

using namespace std;
#define sz(a) int(a.size())
#define ll  long long
#define mod int(1e9+7)
#define endl '\n'
#define ENGZ ios::sync_with_stdio(0);ios_base::sync_with_stdio(0);cin.tie(0) , cout.tie(0) ;
#define pi (acos(-1))
#define S second
#define F first
ll fp(ll n , ll p )
{
    if(p==0)
        return 1;
    if(p==1)
        return n ;
    ll res = fp(n,p/2) ;
    res=((res)*(res)) ;
    if(p%2)
        res=(res*n) ;
    return res ;
}

int main()
{
    ENGZ;
    ll n , k , arr[200005] ;
    cin>> n >> k ;
    for(int i=0 ; i<n ; i++)
    {
        cin>>arr[i] ;
    }
    sort(arr,arr+n);
    ll r = 1e18 , l = -r , mid , ans = 0 ;
    while(l<=r)
    {
        mid = (l+r)/2 ;
        ll he50 = 0 ;
        for(int i=0 ; i<n ; i++)
        {
            int st = i+1 , en = n-1 , m ;
            if(arr[i]>0)
            {
                while(st <= en)
                {
                    m = (st+en)/2 ;
                    if(arr[i]*arr[m] <= mid)
                        st = m+1 ;
                    else
                        en = m-1 ;
                }
                he50 += (en-i);
            }
            else if(arr[i]<0)
            {
                while(st <= en)
                {
                    m = (st+en)/2 ;
                    if(arr[i]*arr[m] > mid)
                        st = m+1 ;
                    else
                        en = m-1 ;
                }
                he50 += (n-st);
            }
            else
            {
                if(mid>=0)
                    he50 += (n-i-1);
            }
        }
        if(he50 < k)
            l = mid+1;
        else
            r = mid-1 ;

    }
    cout<<l <<endl ;
    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long double PI = 3.14159265358979323846;

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

    ll a, b, c, d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (d <= a) {
        printf("%lld", d);
    } else {
        ll ans = a;
        d -= a;
        if (d <= b) {
            printf("%lld", ans);
        } else {
            d -= b;
            ans -= d;
            printf("%lld", ans);
        }
    }

    return 0;
}


Measured memory_bytes: 3856
#include <bits/stdc++.h>
using namespace std;
#define sz(x) ((int) (x).size())

typedef long long ll;

string S, lastCmp, curCmp;

int main(){
	cin >>  S;

	int cnt = 1;
	lastCmp += S[0];
	//cout << lastCmp << endl;
	curCmp = "";
	for(int i=1; i<sz(S); i++){
		curCmp += S[i];
		if(curCmp != lastCmp){
			cnt++;
			//cout << curCmp << " " << lastCmp << endl;
			lastCmp = curCmp;
			curCmp = "";
		}
	}
	cout << cnt << endl;

  return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <algorithm>

struct Point {
	double x, y;
	Point(double x = 0, double y = 0) :x(x), y(y) {};
};

struct Circle {
	double x, y, r;
	Circle(double x = 0, double y = 0, double r = 0) : x(x), y(y), r(r) {};
};

typedef Point Vector;

Vector operator + (Vector A, Vector B) { return Vector(A.x + B.x, A.y + B.y); }
Vector operator - (Vector A, Vector B) { return Vector(A.x - B.x, A.y - B.y); }
Vector operator * (Vector A, double m) { return Vector(A.x * m, A.y * m); }
Vector operator / (Vector A, double m) { return Vector(A.x / m, A.y / m); }

bool operator < (const Point& a, const Point& b) {
	return a.x < b.x || (a.x == b.x && a.y < b.y);
}

const double eps = 1e-9;
int dcmp(double x) {
	if (fabs(x) < eps)
		return 0;
	else
		return x < 0 ? -1 : 1;
}
double Dot(Vector A, Vector B) {
	return A.x*B.x + A.y*B.y;
}
double Length(Vector A) {
	return sqrt(Dot(A, A));
}
double Cross(Vector A, Vector B) {
	return A.x*B.y - A.y*B.x;
}
double distanceToLine(Point P, Point A, Point B) {
	Vector v1 = B - A, v2 = P - A;
	return fabs(Cross(v1, v2)) / Length(v1);
}

bool onLine(Point P, Point A, Vector v) {
	Point B = Point(A.x + v.x*1.0, A.y + v.y*1.0);
	return !dcmp(distanceToLine(P, A, B));
}

bool isSameSign(double a, double b) {
	if (a > 0 && b > 0)
		return 1;
	if (a < 0 && b < 0)
		return 1;
	if (a == 0 && b == 0)
		return 1;
	return 0;
}

bool vectorSameDirection(Vector a, Vector b) {
	return Dot(a, b) > 0;
}

double distanceToOrigin(Point a, Vector v, Circle c) {
	if (vectorSameDirection(v, Vector(c.x - a.x, c.y - a.y)))
		return Length(Vector(c.x - a.x, c.y - a.y));
	else {
		return 2 * c.r - Length(Vector(c.x - a.x, c.y - a.y));
	}
}

int main() {
	//freopen("in.txt", "r", stdin);
	double d;
	while (~scanf("%lf", &d) && d) {
		Vector p, v;
		scanf("%lf%lf%lf%lf", &p.x, &p.y, &v.x, &v.y);
		if (dcmp(Cross(p,v)) == 0 && 
			(dcmp(distanceToOrigin(Point(p.x,p.y), v, Circle(0.0,0.0,1.0)) - d)) <= 0)
			printf("%lf\n", distanceToOrigin(Point(p.x, p.y), v, Circle(0.0, 0.0, 1.0)));
		else
			printf("impossible\n");
	}
	return 0;
}


Measured memory_bytes: 3172
#include <stdio.h>
#define modn 1000000007

long long int mypow(long long int a, long long int n){ // a^n
  long long int ans = 1;
  for(int i=0; i<n; i++)
    ans = ans * a % modn;
  return ans;
}

long long int modpow(long long int a, long long int b, long long int c){
  long long re = 1;
  while(b >= 1){
    if(b & 1) re = re * a % c;
    a = a * a % c;
    b = b >> 1;
  }
  return re;
}

int main(){
  long long int n, k;  scanf("%lld%lld", &n, &k);

  long long int gcdn[100001]; // 1~k

  long long int ans = 0;
  
  for(long long int i=k; i>=1; i--){
    //gcdn[i] = mypow(k/i, n);
    gcdn[i] = modpow((k/i), n, modn);
    for(long long int j=2; i*j<=k; j++)
      gcdn[i] -= gcdn[i*j];
    ans = ans + gcdn[i]*i%modn;
  }

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


Measured memory_bytes: 2480
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 1e18
#define ceill(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
ll mod = 1e9+7;
void ans(bool b, ostream& out=cout){ out << (b ? "Yes" : "No") << endl; }
void ans2(bool b, ostream& out=cout){ out << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){fill((T*)array, (T*)(array+N), val);}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};

#ifndef INCLUDE_DEBUG_HPP
#define INCLUDE_DEBUG_HPP

class debug
{
public:
    template<typename T> void vdeb(T vec);
    template<typename T1, typename T2> void adeb(T1 *arr, T2 n);
    template<typename T> void mdeb(T mp);
};

#endif //INCLUDE_DEBUG_HPP

template<typename T> void debug::vdeb(T vec)
{
    cout << "#vector set debug" << endl;
    for(auto vv : vec) cout << vv << " ";
    cout << endl;
}

template<typename T1, typename T2> void debug::adeb(T1 *arr, T2 n)
{
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}

template<typename T> void debug::mdeb(T mp)
{
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}

debug dbg;

class AFavoriteSound {
public:
	void solve(std::istream& in, std::ostream& out)
	{
	    int a, b, c;
	    in >> a >> b >> c;

	    if(b/a >= c) out << c << endl;
	    else out << b/a << endl;
	}
};


int main() {
	AFavoriteSound solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

class WeightedUnionfind:

    __slots__ = ['nodes','diff_weight']

    def __init__(self, n):
        self.nodes = [-1]*n
        self.diff_weight = [0]*n

    def root(self, x):
        if self.nodes[x] < 0:
            return x
        else:
            root_x = self.root(self.nodes[x])
            self.diff_weight[x] += self.diff_weight[self.nodes[x]]
            self.nodes[x] = root_x
            return root_x

    def unite(self, x, y, w=0):
        w += self.weight(x); w -= self.weight(y)
        x = self.root(x); y = self.root(y)
        if x == y:
            return
        size_x = -self.nodes[x]; size_y = -self.nodes[y]
        if size_x < size_y:
            x, y = y, x; w = -w
        self.nodes[x] += self.nodes[y]
        self.nodes[y] = x
        self.diff_weight[y] = w

    def weight(self, x):
        self.root(x)
        return self.diff_weight[x]

    def diff(self, x, y):
        return self.weight(y) - self.weight(x)

    def same(self, x, y):
        return self.root(x) == self.root(y)

    def size(self, x):
        return -self.nodes[self.root(x)]

N,M = map(int,input().split())
wuf = WeightedUnionfind(N)
ans = "Yes"
for _ in range(M):
    L,R,D = map(int,input().split())
    L -= 1; R -= 1
    if not wuf.same(L,R):
        wuf.unite(L,R,D)
    else:
        if wuf.diff(L,R) != D:
            ans = "No"
            break
print(ans)

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

X = []
Y = []

for _ in range(N):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)

cnt = 0

for i in range(N):
    d = (X[i]**2 + Y[i]**2)**0.5
    if d <= D:
        cnt += 1

print(cnt)

Measured memory_bytes: 24920
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define FOR(i,k,n) for(int(i)=(k);(i)<(n);++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v),end(v)
#define debug(x) std::cerr<<#x<<": "<<x<<"\n"
#define debug2(x,y) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<"\n"
#define debug3(x,y,z) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<", "<<#z<<": "<<z<<"\n"

using ll=long long;
using vi=std::vector<int>;
using vvi=std::vector<vi>;
using vll=std::vector<ll>;
using vvll=std::vector<vll>;
template<typename T> using vvec=std::vector<std::vector<T>>;
template<typename T>
auto make_v(size_t sz){return std::vector<T>(sz);}
template<typename T,typename... Ts>
auto make_v(size_t sz,Ts...ts){return std::vector<decltype(make_v<T>(ts...))>(sz,make_v<T>(ts...));}
template<typename T>
void fill_v(T&var,const T&x){var=x;}
template<typename V,typename T>
void fill_v(V&v,const T&x){for(auto&& w:v){fill_v(w,x);}}

template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<std::vector<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<std::deque<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s, const std::set<T>&v){
  s<<"\n";for(auto&& elm:v){s<<elm<<"\t";}s<<"\n";return s;}

inline void scan(int&a){scanf("%d",&a);}
inline void scan(ll&a){scanf("%lld",&a);}
inline void scan(char&a){scanf(" %c",&a);}
inline void scan(double&a){scanf("%lf",&a);}
template<typename T>
inline void scan(std::vector<T>&v){for(auto&& sv:v){scan(sv);}}
template<typename First,typename...Args>
inline void scan(First&f,Args&...args){scan(f);scan(args...);}
inline void scan(std::string&s){char BUF[3000000];scanf(" %s",BUF);s=std::string(BUF);}
inline void print(int a){printf("%d\n",a);}
inline void print(ll a){printf("%lld\n",a);}
inline void print(double a){printf("%.12f\n",a);}
inline void print(std::string s){std::cout<<s<<"\n";}

using namespace std;

void no() {
  print("No");
  exit(0);
}

void yes() {
  print("Yes");
  exit(0);
}

int main() {
  string s;
  scan(s);
  int l = s.length();
  if (l % 2 == 1) {
    no();
  }
  rep (i, l/2) {
    if (s.substr(i*2, 2) != "hi") {
      no();
    }
  }
  yes();
  return 0;
}


Measured memory_bytes: 888
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {($($a:expr),*) => {println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);}}
#[allow(unused_macros)]
macro_rules! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);
impl<T: PartialEq> Eq for Total<T> {}
impl<T: PartialOrd> Ord for Total<T> { fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering { self.0.partial_cmp(&other.0).unwrap() }}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;


fn main() {
    input!{s:String};
    println!("{}", if s.starts_with("YAKI") {"Yes"} else {"No"});
}


Measured memory_bytes: 4352
#include<stdio.h>

int main(){
	int a,b,c;
	int x,y,z;
	int ans[4]={0};
	
	while(scanf("%d %d %d",&a,&b,&c)!=EOF){
		if(a >= b && a >= c){
			x=a; y=b; z=c;
		}
		else if(b >= a && b >=c){
			x=b; y=a; z=c;
		}
		else if(c >= a && c >= b){
			x=c; y=a; z=b;
		}
		/*△かどうか*/
		if(x >= y+z)break;
		
		if(x*x == y*y+z*z)
			ans[1]++;
		else if(x*x >y*y+z*z)
			ans[3]++;
		else ans[2]++;
		
		ans[0]++;
		
		
	}
	
	for(int i=0;i<3;i++)
		printf("%d ",ans[i]);
	printf("%d\n",ans[3]);
	
	return 0;
	
}


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

int main(){
	int n;
	cin >> n;
	vector<int> a(n+1);
	for(int i=1; i<=n; i++){
		cin >> a[i];
	}
	int ans = 0;
	for(int i=1; i<=n; i++){
		if(a[a[i]] == i) ans++;
	}
	cout << ans/2 << endl;
	return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<N;i++)
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
int main(){
  int N; cin>>N;
  vvi F(N,vi(10)), P(N,vi(11));
  rep(i,N) rep(j,10) cin>>F[i][j];
  rep(i,N) rep(j,11) cin>>P[i][j];
  ll ans = -1e9;
  for (int i=1; i<(1<<10); i++){
    ll bene = 0;
    rep(j,N){
      int cnt = 0;
      rep(k,10)
        if(i & (1<<k) && F[j][k]) cnt++;
      bene += P[j][cnt];
    }
    ans = max(ans,bene);
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
  int N;
  cin >> N;
  int a[N];
  for (int i = 0; i < N; i++)
    cin >> a[i];
  long ans = 0;
  for (int i = 0; i < N; i++)
    ans += a[i] - 1;
  cout << ans << endl;
}

Measured memory_bytes: 256
local mfl, mce, mmi = math.floor, math.ceil, math.min
local mma = math.max
local SegTree = {}
SegTree.updateAll = function(self)
  for i = self.stagenum - 1, 1, -1 do
    for j = 1, self.cnt[i] do
      self.stage[i][j] = self.stage[i + 1][j * 2 - 1] + self.stage[i + 1][j * 2]
    end
  end
end
SegTree.clear = function(self)
  for i = self.stagenum, 1, -1 do
    for j = 1, self.cnt[i] do
      self.stage[i][j] = 0
    end
  end
end
SegTree.create = function(self, n)
  local stagenum, mul = 1, 1
  self.cnt, self.stage, self.size = {1}, {{}}, {}
  while mul < n do
    mul, stagenum = mul * 2, stagenum + 1
    self.cnt[stagenum], self.stage[stagenum] = mul, {}
  end
  for i = 1, stagenum do self.size[i] = self.cnt[stagenum + 1 - i] end
  self.stagenum = stagenum
  self:clear()
end
SegTree.getRange = function(self, right)
  local stage = 1
  while right < self.size[stage] do
    stage = stage + 1
  end
  local ret = 0
  local l, r = 1, right
  while true do
    local sz = self.size[stage]
    ret = ret + self.stage[stage][mce(l / sz)]
    l = l + sz
    if l <= r then
      local nsize = r + 1 - l
      while nsize < self.size[stage] do
        stage = stage + 1
      end
    else
      break
    end
  end
  return ret
end
SegTree.inc = function(self, idx)
  self.stage[self.stagenum][idx] = self.stage[self.stagenum][idx] + 1
end
SegTree.dec = function(self, idx)
  self.stage[self.stagenum][idx] = self.stage[self.stagenum][idx] - 1
  for i = self.stagenum - 1, 1, -1 do
    local dst = mce(idx / 2)
    local rem = dst * 4 - 1 - idx
    self.stage[i][dst] = self.stage[i + 1][idx] + self.stage[i + 1][rem]
    idx = dst
  end
end
SegTree.new = function(n)
  local obj = {}
  setmetatable(obj, {__index = SegTree})
  obj:create(n)
  return obj
end

local n = io.read("*n")
local a = {}
local t = {}
for i = 1, n do
  a[i] = io.read("*n")
  t[i] = a[i]
end
table.sort(t)
local totcnt = mfl(n * (n + 1) / 2)
local st = SegTree.new(n * 2 + 1)
local z = {}
local function solve(v)
  st:clear()
  local ofst = n + 1
  z[1] = v <= a[1] and 1 or -1
  for i = 2, n do
    z[i] = v <= a[i] and z[i - 1] + 1 or z[i - 1] - 1
  end
  for i = 1, n do
    st:inc(z[i] + ofst)
  end
  st:updateAll()
  local cnt = 0
  local n2_1 = 2 * n + 1
  for i = 1, n do
    local left = i == 1 and ofst or z[i - 1] + ofst
    if left <= 1 then
      cnt = cnt + n + 1 - i
    else
      cnt = cnt + n + 1 - i - st:getRange(left - 1)
    end
    st:dec(z[i] + ofst)
  end
  return totcnt <= cnt * 2
end
local function solveAll()
  if solve(t[n]) then
    return t[n]
  end
  local min, max = 1, n
  while 1 < max - min do
    local mid = mfl((min + max) / 2)
    if solve(t[mid]) then
      min = mid
    else
      max = mid
    end
  end
  return t[min]
end
print(solveAll())


Measured memory_bytes: 7676
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using str = string;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
const double PI = 3.141592653589793238;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define REP(i, m, n) for (int i = m; i < (int)n; i++)
#define all(a) (a).begin(), (a).end()
#define allg(a) (a).begin(), (a).end(), greator<>()
#define d20 std::setprecision(20)
#define veci vector<int>
#define vecll vector<long long int>
#define vecd vector<double>
template <typename T>
T lcm(T a, T b)
{
	return a / __gcd(a, b) * b;
}
void comb(vector<vector<long long int>> &v)
{
	for (int i = 0; i < v.size(); i++)
	{
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (int k = 1; k < v.size(); k++)
	{
		for (int j = 1; j < k; j++)
		{
			v[k][j] = (v[k - 1][j - 1] + v[k - 1][j]);
		}
	}
}
bool is_not_out_of_range(size_t now, size_t max_num)
{
	return !(now < 0 || max_num <= now);
}
ll repeat_squaring(ll n, ll p, ll m)
{
	if (p == 0)
		return 1;
	if (p % 2 == 0)
	{
		ll t = repeat_squaring(n, p / 2, m);
		return t * t % m;
	}
	return n * repeat_squaring(n, p - 1, m);
}

int main()
{
	int a, b;
	cin >> a >> b;
	ll ans = 1;
	rep(i, a)
	{
		ans *= b - (i > 0);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);

  int N;

  std::cin >> N;

  long long a[111];

  a[0] = 2;
  a[1] = 1;

  for (int i = 2; i <= N; i ++)
    a[i] = a[i - 2] + a[i - 1];

  std::cout << a[N] << std::endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define ALL(a) a.begin(), a.end()
typedef long long ll;
#define MOD 1000000007
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

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

  ll N; cin>>N;
  set<string> st;

  rep(i,N) {
    string S; cin>>S;
    st.insert(S);
  }

  cout<<st.size()<<endl;

  return 0;
}


Measured memory_bytes: 19284
import sys
readline = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
 

N = int(readline())
XL = map(int, read().split())
 
LR = sorted(
    [(x - l, x + l) for x, l in zip(XL, XL)],
    key=lambda x: x[1])
LR = [(-3 * 10 ** 9, -3 * 10 ** 9)] + LR
 

i = 1
while True:
    if len(LR) <= i:
        break
 
    _, pr = LR[i - 1]
    cl, cr = LR[i]
 
    if pr <= cl:
        i += 1
    else:
        del LR[i]

print(len(LR) - 1)

Measured memory_bytes: 34096
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>

using namespace std;

int main(){
	int dp1[50][3001];
	int dp2[50][3001];
	// x?????????, ?????¨???????¨???????y
	int mod=100000;
	int n,m,s;
	while(scanf("%d%d%d",&n,&m,&s)){
		if(n==0&&m==0&&s==0)
		break;
		
		memset(dp1,0,sizeof(dp1));
		dp1[0][0]=1;
		for(int i=1;i<=m;i++){
			memset(dp2,0,sizeof(dp2));
			for(int j=0;j<n*n+1;j++){
				for(int k=0;k<s+1;k++){
					//i???????????´???
					if(j<n*n&&k+i<=s){
						dp2[j+1][k+i]+=dp1[j][k];
						dp2[j+1][k+i]%=mod;
					}
					//??????????????´???
					dp2[j][k]+=dp1[j][k];
					dp2[j][k]%=mod;
				}
			}
			//dp2???dp1????????????
			for(int j=0;j<n*n+1;j++){
				for(int k=0;k<s+1;k++){
					dp1[j][k]=dp2[j][k];
				}
			}
		}
		printf("%d\n",dp1[n*n][s]);
	}
}

Measured memory_bytes: 4380
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;

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

int main(){
    int n,m;
    string s="IMPOSSIBLE";
    cin>>n>>m;
    vector<pair<int,int>>a(300000);
    vector<int>b(300000);
    for(int i=0;i<m;i++){
        cin>>a[i].first>>a[i].second;
    }
    sort(a.begin(),a.end(),greater<>());
    for(int i=0;i<m;i++){
        if(a[m-1-i].first==1){
            b[a[m-1-i].second]++;
        }
        else{
            break;
        }
    }
    for(int i=0;i<m;i++){
        if(b[a[i].first]>0&&a[i].second==n){
            s="POSSIBLE";
        }
    }
    cout<<s<<endl;
    return 0;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using pll = pair<ll, ll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U>bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U>bool isin(T el, U container) { return find(all(container), el) != container.end(); }
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<class T>bool even(T n) { return ! (n & 1); }
template<class T>bool odd(T n) { return n & 1; }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
ll intpow(ll a,ll n){ll p=1;while(n){if(n&1)p*=a;a*=a;n>>=1;}return p;}
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;



int main()
{
        ll A, B, K;
        cin >> A >> B >> K;
        ll cnt = 0;
        ll tmp = 0;
        repreverse(i, 100, 1) {
                if (A % i == 0 and B % i == 0) {
                        tmp = i;
                        ++cnt;
                }
                if (cnt == K) break;
        }
        cout << tmp << endl;
}

Measured memory_bytes: 3640
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {
        Scanner input = new Scanner(System.in);
        StringBuilder build = new StringBuilder();
        while(true){
            int h = input.nextInt();
            int w = input.nextInt();
            if(h==0&&w==0){
                break;
            }
            for(int n = 0; n < h; n++){
                for(int i = 0; i < w; i++){
                    if((n == 0 || n == h-1)||(i==0 || i==w-1)){
                    build.append("#");
                    }else{
                    build.append(".");
                    }
                }
                build.append("\n");
            }
             build.append("\n");
        }
        System.out.print(build);
    }
}

Measured memory_bytes: 27476
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int[] a = new int[n];
		for(int i = 0; i < k; i++){
			int d = sc.nextInt();
			for(int j = 0; j < d; j++){
				a[sc.nextInt()-1] += 1;
			}
		}
		int num = 0;
		for(int e : a){
			if(e == 0)num += 1;
		}
		System.out.println(num);
	}
	
}

Measured memory_bytes: 46052
#include <bits/stdc++.h>
#define reg register

using namespace std;

typedef long long ll;
const int maxn = 100005;

inline ll read() {
    reg ll s = 0, t = 0; reg char ch = getchar();
    while (!isdigit(ch)) t |= ch == '-', ch = getchar();
    while (isdigit(ch)) s = (s << 1) + (s << 3) + (ch ^ 48), ch = getchar();
    return t ? -s : s;
}

int main() {
    char a[5];
    scanf("%s", a + 1);
    for (reg int i = 2; i <= 4; i++)
        if (a[i] == a[i - 1]) { cout << "Bad" << endl; return 0; }
    cout << "Good" << endl;
    return 0;
}


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

 
int main(void) { 
    int n;
    int x;
    //vector<int> lst(n);
    cin>>n;

    for (int i=0;i<n;i++){
        cin>>x;
        if (x %2==0 && (x %3!=0 && x % 5!=0)){
            cout<<"DENIED"<<endl;
            return 0;
        }
    }
    
    cout<<"APPROVED"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int  a, b ,c;
    char X,Y;
    string S;
    cin >> X >> Y;
    if(X>Y) cout << '>' << endl;
    if(X == Y) cout << '=' << endl;
    if(X < Y) cout << '<' << endl;
}


Measured memory_bytes: 256
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 1
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	s := getNextString(scanner)
	rr := make([]int, n+1)
	gg := make([]int, n+1)
	bb := make([]int, n+1)

	for i := 0; i < n; i++ {
		rr[i+1] = rr[i]
		gg[i+1] = gg[i]
		bb[i+1] = bb[i]
		if s[i] == 'R' {
			rr[i+1]++
		}
		if s[i] == 'G' {
			gg[i+1]++
		}
		if s[i] == 'B' {
			bb[i+1]++
		}
	}
	var ans int64
	for i := 0; i < n; i++ {
		for j := i + 2; j < n; j++ {
			if s[i] == s[j] {
				continue
			}
			if s[i] != 'R' && s[j] != 'R' {
				ans += int64(rr[j] - rr[i+1])
				if (j-i)%2 == 0 && s[(i+j)/2] == 'R' {
					ans--
				}
				continue
			}
			if s[i] != 'G' && s[j] != 'G' {
				ans += int64(gg[j] - gg[i+1])
				if (j-i)%2 == 0 && s[(i+j)/2] == 'G' {
					ans--
				}
				continue
			}
			if s[i] != 'B' && s[j] != 'B' {
				ans += int64(bb[j] - bb[i+1])
				if (j-i)%2 == 0 && s[(i+j)/2] == 'B' {
					ans--
				}
				continue
			}
		}
	}
	fmt.Fprintln(writer, ans)
}


Measured memory_bytes: 1932
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<vector>
#include<set>
using namespace std;
const int INF=1e9+7;
typedef long long ll;
int main()
{
    int n,a,b;
    cin>>n>>a>>b;
    cout<<min(a*n,b)<<endl;
    return 0;
}


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

#define llong long long
#define fr(i,l,r) for(i=(l);i<(r);i++)
#define min(p,q)((p)<(q)?(p):(q))


int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}



int main(void)
{
	//変数の宣言
	int n;
	int a[100010];
	
	
	//よく使う変数
	int i,j,k,l;
	int flag=0;
	llong int ans=0;
	int count=0;
	int sum=0;
	long int temp,temp1,temp2;
	int max,min;
	int len;
	//データの読み込み
	
	scanf("%d",&n);
	
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	
	
//	printf("nは%dです\n", n);
//	printf("データの読み込み終了\n");
	//実際の処理
	
	
	qsort(a, n, sizeof(int), compare_int);
	
//	for(i=0;i<n;i++){
//		printf("%d ",a[i]);
//	}
	
	temp=0;
	for(i=0;i<n;i++){
		if(n%2==1){
			if((i+1)/2*2!=a[i]){
				flag=1;
//				printf("i=%dでflag a[i]=%d,%d\n",i,a[i],(i+1)/2*2);
			}
		}else{
			if(1+i/2*2!=a[i]){
				flag=1;
//				printf("i=%dでflag\n",i);
			}
		}
	}
	
//	printf("flag=%d\n",flag);
	
	if(flag==1){
		printf("0");
	}else{
		temp=1;
		for(i=0;i<n/2;i++){
			temp=temp*2;
			temp=temp%1000000007;
		}
		printf("%ld",temp);
	}
	
	
//	printf("計算部分終了\n");
	//出力
	
	
//	printf("結果の出力終了\n");
	
	return 0;
	
}



Measured memory_bytes: 892
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,K;
  cin >> N >>K;

  double p=0;
  
  for (int i=1;i<N+1;i++){
    int s=i;
    double pn=1./N;
    while (s<K){
      s=s*2;
      pn=pn/2.;
    }
    p+=pn;
  }
  cout << setprecision(13)<< p <<endl;
  
}

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

class main{
  public static void Main(string[] args){
    string s = Console.ReadLine();
    char[] former = new char[s.Length/2];
    char[] latter = new char[s.Length/2];
    int cnt = 0;
    
    for(int i = 0; i < former.Length; i++){
      former[i] = s[i];
      latter[i] = s[s.Length - 1 - i];
      
      if(former[i] != latter[i]) cnt++;
    }
    Console.WriteLine(cnt);
  }
}


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

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

    int n, k;
    cin >> n >> k;
    int ans = 0;
    while(n > 0){
        n /= k;
        ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define divup(a,b) ( ( (a) + ( (b) - 1u) ) / (b) ) // a/b の余り切り上げ
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int mod = 1000000007;

int main(){
    ll n,x;
    cin>>n>>x;
    ll l[10009];
    rep(i,n){
        cin>>l[i];
    }
    ll s=0,ct=1;
    rep(i,n){
        s += l[i];
        if(s<=x) ct++;
        else break;
    }
    cout<<ct<<endl;
}


Measured memory_bytes: 256
using System;
     
        class Program2
        {
            static void Main(string[] args)
            {
             string[] _strinput=Console.ReadLine().Split();
             int iA=int.Parse(_strinput[0]), iB = int.Parse(_strinput[1]);
             Console.WriteLine(Math.Ceiling((double)(iA+iB)/2));
            
                
            }
        }

Measured memory_bytes: 11092