akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for(long long i=0; i<n; i++)
#define Rep(i,n) for(long long i=1; i<n; i++)
#define ll long long
#include <math.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <vector>


using namespace std;
#define PI acos(-1)
using P =pair<ll,ll>;

ll ketasu(ll a){
   ll num=1;
   while(a/10){
       num++;
       a/=10;
   }
   return num;
}

ll gcd(ll a,ll b){return b ? gcd(b,a%b) :a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

ll kosuu(ll a){
    ll sum=0;
    for(ll i=1;i*i<=a;i++){
        if(a%i==0){
            if(a!=1&&i*i!=a){
            sum+=2;
            }else{
             sum++;   
            }
        }
    }
    return sum;
}






ll di[]={1,0,-1,0};
ll dj[]={0,-1,0,1};

struct UnionFind {
    vector<int>d;
    UnionFind(int n=0):d(n,-1){}
    int find(int x){
        if((d[x])<0)return x;
        return d[x]=find(d[x]);
    }
    bool unite(int x,int y){
        x =find(x);y=find(y);
        if(x==y)return false;
        if(d[x]>d[y])swap(x,y);
        d[x]+=d[y];
        d[y]=x;
        return true;
    }
    bool same(int x,int y){return find(x)==find(y);};
    ll size(ll x){return -d[find(x)];};
};

int deg[100005];
vector<int> to[100005];





// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

mint f(int n) {
    if(n==0)return 1;
    mint x=f(2/n);
    x*=x;
    if(n%2==1)x*=2;
    return x;
}

mint choose(int n,int a){
    mint x =1,y=1;
    rep(i,a){
      x*=n-i;
      y*=a+i;
    }
    return x/y;
}
const ll m=1000005;

int main()
{
 ll h,w,k;
 cin>>h>>w>>k;
 vector<string>s(h);
 rep(i,h)cin>>s[i];
 ll ans=0;
 rep(i,1<<h){
     rep(j,1<<w){
         ll cnt=0;
         for(ll is=0;is<h;is++){
             for(ll js=0;js<w;js++){
                 if(i>>is&1)continue;
                 if(j>>js&1)continue;
                 if(s[is][js]=='#')cnt++;
             }
         }
         if(cnt==k)ans++;
     }
 }
 cout<<ans<<endl;
}

 




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

int main(){
  int x ;
  cin >> x;
  int temp = x;
  int digit_sum = 0;
  while(x>0){
    digit_sum+=(x%10);
    x/=10;
  }
  if((temp%digit_sum)==0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

using std::string;
using std::vector;
using std::set;
using std::unordered_set;
using std::map;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char CRLF = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }

void solve(void)
{
  ui a, b; cin >> a >> b;
  ui res{1};
  ui ans{};
  while(res < b)
  {
    res += a;
    res -= 1;
    ++ans;
  }
  cout << ans << CRLF;
  return;
}

int main(void)
{
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);

  solve();

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define MOD 1000000007
#define EPS 1e-10
#define MAX_N 100100
#define MAX_M 100100

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;
typedef pair<int, string> PSI;

int n, k;

int main(){
	while (cin >> n >> k&&n + k){
		int cnt[100010] = {};
		REP(i, k){
			int num;
			cin >> num;
			cnt[num] = 1;
		}
		
		FOR(i, 2, n + 1){
			if (cnt[i] != 0)cnt[i] += cnt[i - 1];
		}
		int ans = 0;
		if (cnt[0] == 1){
			cnt[0] = 0;
			for (int i = n; i >= 1; i--){
				if (cnt[i] != 0){
					int num = i;
					i--;
					while (cnt[i] > 0){
						cnt[i] = cnt[num];
						i--;
					}
				}
			}
			FOR(i, 2, n){
				if (cnt[i] == 0){
					ans = max(ans, cnt[i - 1] + 1 + cnt[i + 1]);
				}
			}
		}
		else{
			FOR(i, 1, n + 1){
				ans = max(ans, cnt[i]);
			}
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 1556
#include <string>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <iostream>
#include <functional>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <cmath>
#include <limits>
#include <tuple>
#include <queue>
#include <stack>

using namespace std;
typedef long long ll;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()

ll simul(ll K, ll A, ll B)
{
	ll bis = 1;
	ll yen = 0;
	ll k = K;
	while (k > 0) {
		if (yen >= 1) {
			yen--;
			bis += B;
		} else if (bis >= A && k != 1) {
			yen ++;
			bis -= A;
		} else {
			bis++;
		}
		k--;
	}
	return bis;
}

int main()
{
	ll K, A, B;
	cin >> K >> A >> B;
	ll x = simul(K, A, B);
	ll y = K + 1;
	ll ans = max(x, y);
	cout << ans << endl;
	return 0;
}


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

namespace Dubious
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] totalCounts = new int[26];
            int[] counts = new int[26];
            String S;
            for (int i=0; i < n; i++)
            {
                S = Console.ReadLine();
                for (int j = 0; j < 26; j++)
                    counts[j] = 0;
                foreach (char c in S)
                {
                    counts[c - 'a']++; 
                }

                if (i == 0)
                {
                    for (int j = 0; j < 26; j++)
                        totalCounts[j] = counts[j];
                }
                else
                {
                    for (int j = 0; j < 26; j++)
                    {
                        if (counts[j] < totalCounts[j])
                            totalCounts[j] = counts[j];
                    }
                }

            }

            for(int j = 0; j < 26; j++)
            {
                for (int k = 0; k < totalCounts[j]; k++)
                    Console.Write((char)(j + 'a'));
            }
            Console.WriteLine();
        }
    }
}


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

int main() {
    using namespace std;
    using ll = long long;

    int N; std::cin >> N;
    std::vector<ll> A(N + 1), B(N + 1);
    for (int i = 0; i <= N; ++i) cin >> A[i];
    B[N] = A[N];
    for (int i = N - 1; i >= 0; --i) B[i] = B[i + 1] + A[i];
    B[0] = 1;
    for (int i = 1; i <= N; ++i) B[i] = min(B[i], 2 * (B[i - 1] - A[i - 1]));
    ll ans = 0;
    for (int i = 0; i <= N; ++i) {
        if (B[i] < A[i]) {
            cout << -1 << endl;
            return 0;
        }
        ans += B[i];
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4816
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;

#define all(x) x.begin(),x.end()
#define YES {cout << "YES\n"; return;}
#define NO {cout << "NO\n"; return;}

const int INF=INT_MAX;
const ld PI=acos(-1);//3.1415926535897932384626433
const ld E=2.71828183;
const int MOD=1e9+7;

vi bfs(vector<vi>adj,int src){
    //adjacency list, not-weighted, possibly directed ,src is 1-indexed, adj[0].size()=0!!!
    //for n vertices, adj.size()=n+1. (constructed via push_back() ).

    queue<int>q;
    q.push(src);
    vi dst(adj.size(),INF);
    dst[src]=0;
    while(!q.empty()){
        int c=q.front();
        q.pop();
        for(int nbr:adj[c]){
            if(dst[nbr]==INF){
                dst[nbr]=dst[c]+1;
                q.push(nbr);
            }
        }
    }
    return dst;
}
vi bfsParents(vector<vi>adj,int src){
    vi parents=vi(adj.size(),INF);
    parents[src]=-1;
    queue<int>q;
    q.push(src);
    vi dst(adj.size(),INF);
    dst[src]=0;
    while(!q.empty()){
        int c=q.front();
        q.pop();
        for(int nbr:adj[c]){
            if(dst[nbr]==INF){
                parents[nbr]=c;
                dst[nbr]=dst[c]+1;
                q.push(nbr);
            }
        }
    }
    return parents;
}
vi shortestPath(vector<vi>adj,int src,int dst){
    vi bfsParetns=bfsParents(adj,src);
    vi ans;
    while(src!=dst){
        if(bfsParetns[src]==INF)
            return {};
        ans.push_back(src);
        src=bfsParetns[src];
    }
    return ans;
}
int powMod(int base,int exp,int mod){
    //(base^exp) %mod
    int ans=1;
    for(int i=0; i<exp; i++)
        ans=((ans%mod)*(base%mod))%mod;
    return ans;
}
vi divisorsOf(int n){
    //vector of divisors of n (inc. 1 , excl.n)
    vi ans;
    for(int i=1; i*i<=n; i++){
        if(n%i==0)
            ans.push_back(i);
        if(i*i!=n && i!=1)
            ans.push_back(n/i);
    }
    return ans;
}

ll gcd(ll a,ll b){if(a%b==0) return b; else return gcd(b,a%b);}
ld log (ld a,ld b){return log(b)/log(a);}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}
ll power(ll base, ll exp){ll res=1;while(exp){exp--;res*=base;}return res;}

void solve();
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    //cin >> t;
    while(t--)
        solve();
    return 0;
}
void solve (){
    ll a,b;
    cin >> a >> b;
    cout << lcm(a,b)<<"\n";
}

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

int main() {
  int N;
  cin >> N;
  int a[N];
  for(int i=0; i<N; i++) {
    cin >> a[i];
  }
  sort(a, a+N);
  cout << a[N/2]-a[N/2-1] << endl;
}

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

int main(){
  int n, s;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> s;
    if(s % 2 == 1){
      if(i == n - 1) cout << "APPROVED" << endl;
      else continue;
    }
      else if(s % 5 != 0 && s % 3 != 0){
        cout << "DENIED" << endl;
        break;
      }
    else{
      if(i == n - 1) cout << "APPROVED" << endl;
      else continue;
    }
    }
  }



Measured memory_bytes: 256
def rangesum(n, k):
    return k * n + (k - 1) * k // 2

def calc(N, K):
    x = 0
    for i in range(K, N + 2):
        x += rangesum(N + 1 - i, i) - rangesum(0, i) + 1
    return x % (10 ** 9 + 7)


(N, K) = tuple([int(s) for s in input().split()])
print(calc(N, K))

Measured memory_bytes: 64404
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// Welcome to my source code!

int main() {
    int a[3][3];
    for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) cin >> a[i][j];
    int n;
    cin >> n;
    bool bingo[3][3] = {};
    int b[n];
    for (int i = 0; i < n; i++) {
        cin >> b[i];
        for (int k = 0; k < 3; k++) for (int j = 0; j < 3; j++) {
            if (b[i] == a[k][j]) {
                bingo[k][j] = true;
            }
        }
    }
    bool flag = false;
    for (int j = 0; j < 3; j++) {
        if (bingo[0][j] && bingo[1][j] && bingo[2][j]) flag = true;
    }
    for (int i = 0; i < 3; i++) {
        if (bingo[i][0] && bingo[i][1] && bingo[i][2]) flag = true;
    }
    if (bingo[0][0] && bingo[1][1] && bingo[2][2]) flag = true;
    if (bingo[2][0] && bingo[1][1] && bingo[0][2]) flag = true;
    if (flag) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#include <set>
#include <map>
#include <list>
 
using namespace std;

int calc(int num){
    vector<int> res;
    for (int i = 1; i * i <= num; ++i) {
        if (num % i == 0) {
            res.push_back(i);
            // 重複しないならば i の相方である N/i も push
            if (num/i != i) res.push_back(num/i);
        }
    }
    return res.size();
}

int main() {
	int n;
	cin >> n;
    long long result =0;
	for(int i=1; i<n; i++){
	    result += calc(i);
	}
    cout << result << endl;
	return 0;
}

Measured memory_bytes: 3616
n,k=map(int,input().split())
mod=998244353
l=[0]*n
r=[0]*n
for i in range(k):
  l[i],r[i]=map(int,input().split())
dp=[0]*(n+10)
dp[0]=1
sumdp=[0]*(n+10)
sumdp[1]=1
for i in range(1,n):
  for j in range(k):
    li=max(0,i-r[j])
    ri=max(0,i-l[j]+1)
    dp[i]+=sumdp[ri]-sumdp[li]
  sumdp[i+1]=(sumdp[i]+dp[i])%mod
print(dp[n-1]%mod)

Measured memory_bytes: 80280
#include<bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)

using namespace std;

int main(int argc, char *argv[]) {
	
	int a; cin >> a;
	int x,y;

	cout << "ABC" << a << endl;

	return 0;
}


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

using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

inline int toInt(string s) {int v; istringstream sin(s);sin>>v; return v;}

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector< vector<int> > Mat;
typedef tuple<int, int, int, int> T;

const int MOD = (int)1e9+7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

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

    int a, b, c;
    cin >> a >> b >> c;

    int ans = 0;
    if(c <= b) ans = b + c;
    else if(c <= a + b) ans = b + c;
    else ans = b + (a + b + 1);

    cout << ans << endl;

    return 0;
}

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

#define int long long
#define endl '\n'

signed main() {
    ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    int n; cin >> n;
    string s; cin >> s;
    s = "@" + s;
    set<int> pos[26];
    for (int i = 1; i <= n; i++) 
        pos[s[i] - 'a'].insert(i);
    int q; cin >> q;
    while (q--) {
        int type; cin >> type;
        if (type == 1) {
            int id; cin >> id;
            char c; cin >> c;
            pos[s[id] - 'a'].erase(id);
            pos[c - 'a'].insert(id);
            s[id] = c;
        } else {
            int l, r; cin >> l >> r;
            int cnt = 0;
            for (int i = 0; i < 26; i++) {
                auto k = pos[i].lower_bound(l);
                if (k == pos[i].end())  continue;
                cnt += (*k <= r);
            }
            cout << cnt << endl;
        }
    }
}

Measured memory_bytes: 24240
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define NUM 2002

int num_stop,num_man,num_bus;
int dp[NUM][NUM];
int ADD[NUM][NUM];
int stop_loc[NUM];

void recursive(int bus_id,int base_man_min,int base_man_max,int pick_up_start_min,int pick_up_start_max){

	int base_mid = (base_man_min+base_man_max)/2;

	int minimum = dp[base_mid][bus_id-1],min_start = pick_up_start_min;

	for(int i = pick_up_start_min; i <= min(base_mid,pick_up_start_max); i++){

		if(dp[i-1][bus_id-1] == BIG_NUM)continue;

		if(minimum > dp[i-1][bus_id-1]+ADD[base_mid][i]){

			minimum = dp[i-1][bus_id-1]+ADD[base_mid][i];
			min_start = i;
		}
	}
	dp[base_mid][bus_id] = minimum;

	if(base_man_min <= base_mid-1 && pick_up_start_min <= min_start){
		recursive(bus_id,base_man_min,base_mid-1,pick_up_start_min,min_start+1);
	}
	if(base_mid+1 <= base_man_max && min_start <= pick_up_start_max){
		recursive(bus_id,base_mid+1,base_man_max,min_start,pick_up_start_max);
	}
}

int main(){

	scanf("%d %d %d",&num_stop,&num_man,&num_bus);

	for(int i = 1; i <= num_stop; i++){
		scanf("%d",&stop_loc[i]);
	}
	vector<int> T;

	int tmp_time,tmp_stop;
	T.push_back(-BIG_NUM);

	for(int loop = 0; loop < num_man; loop++){
		scanf("%d %d",&tmp_time,&tmp_stop);
		T.push_back(tmp_time-stop_loc[tmp_stop]);
	}
	sort(T.begin(),T.end());

	for(int i = 0; i <= num_man; i++){
		for(int k = 0; k <= num_bus; k++){
				dp[i][k] = BIG_NUM;
		}
	}

	int tmp_sum;

	for(int i = 1; i <= num_man; i++){
		tmp_sum = 0;
		for(int k = i; k >= 1; k--){
			tmp_sum += T[i]-T[k];
			ADD[i][k] = tmp_sum;
		}
	}

	dp[0][0] = 0;

	for(int i = 1; i <= min(num_man,num_bus); i++){
		recursive(i,1,num_man,1,num_man);
	}

	printf("%d\n",dp[num_man][min(num_man,num_bus)]);

	return 0;
}



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

#define rep(i, n) for(int i=0;i<(int)n;++i)
using P = pair<int, int>;
const int INF = 1001001001;

int binary_brute_force(const vector<P> &vec, int G)
{
    int n = vec.size(), ans = INF, num_p, point;
    for(int i=0;i<(1 << n);++i)
    {
        num_p = 0;
        point = 0;
        for(int j=0;j<n;++j)
        {
            if((i >> j) & 1)
            {
                num_p += vec[j].first;
                point += vec[j].first * 100 * (n-j) + vec[j].second;
            }
        }

        for(int j=0;j<n;++j)
        {
            if(G <= point) break;
            if(!((i >> j) & 1))
            {
                if(G <= point + (vec[j].first-1) * 100 * (n-j)){
                    num_p += (G - point - 1) / (100 * (n-j)) + 1;
                    ans = min(ans, num_p);
                    break;
                }
                else{
                    num_p += vec[j].first - 1;
                    point += (vec[j].first-1) * 100 * (n-j);
                }
            }
        }
        if(G <= point) ans = min(ans, num_p);
    }
    return ans;
}

int dfs(const vector<P> &vec, int G, int point, int num, int index, int state)
{
    int ans;
    int n = vec.size();
    if(G <= point){
        return num;
    }
    if(index >= vec.size())
    {
        for(int i=0;i<n;++i)
        {
            if(!((state >> i) & 1))
            {
                if(G <= point + (vec[i].first - 1)*100*(n-i))
                {
                    num += (G - point - 1) / (100*(n-i)) + 1;
                    return num;
                }
                else{
                    num += vec[i].first - 1;
                    point += (vec[i].first - 1)*100*(n-i);
                }
            }
        }
        if(G > point) return INF;
        else return num;
    }
    // indexの問題を全部解く
    ans = dfs(vec, G, point+vec[index].first*100*(n-index)+vec[index].second, num+vec[index].first, index+1, state + (1 << index));
    // 解かない
    ans = min(ans, dfs(vec, G, point, num, index+1, state));
    return ans;
}

int main()
{
    int D, G;
    cin >> D >> G;
    vector<P> vec(D);
    rep(i, D) cin >> vec[i].first >> vec[i].second;
    reverse(vec.begin(), vec.end());
    //cout << binary_brute_force(vec, G) << endl;
    cout << dfs(vec, G, 0, 0, 0, 0) << endl;
}


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

int main()
{
	int a[105],amin=1000000000,amax=0,b;
	cin>>b;
	for(int i=1;i<=b;i++)
	{
		cin>>a[i];
		if(a[i]>amax) amax=a[i];
		if(a[i]<amin) amin=a[i];
	}
	cout<<amax-amin;
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define MP make_pair
#define PB push_back

int main(){
	
	int N, K;
	string S;
	cin >> N >> K >> S;
	S[K-1] = S[K-1] - 'A' + 'a';
	cout << S << endl;

	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();

		int count = 0;

		for (int i = 0; i <= A ; i++) {
			for (int j = 0; j <= B; j++) {
				for (int k = 0; k <= C; k++) {
					if (500*i + 100*j + 50*k == X) {
						count += 1;
					}
				}
			}
		}
		System.out.println(count);

	}
}


Measured memory_bytes: 23252
#include <bits/stdc++.h>
#define f(i,a,b) for(i=a;i<=b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define ss second
#define ff first
#define ll long long
#define mod (1000*1000*1000+7)
#define scan1(x) scanf("%lld",&x)
#define scan2(x,y) scanf("%lld %lld",&x,&y)
#define scan3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define print(x) printf("%lld\n",x)
#define ff first
#define ss second
using namespace std;


int main(){
    ll n,i,j;
    scan1(n);
    ll h[n+1];
    f(i,1,n)
    scan1(h[i]);
    
    vector<ll> dp(n+1);
    
    dp[2]=abs(h[2]-h[1]);
    
    f(i,3,n)
    dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
    
    cout<<dp[n]<<"\n";
    
    
}

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

using namespace std;

typedef pair<int, int> P;
#define int long long
#define ll long long
#define mod 1000000007
#define INF (1LL<<60)

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


signed main(){

	int H, W;
	cin >> H >> W;
	char a[100][100];
	int cnt[26] = { 0 };
	for (int i = 0; i < H; i++)
		for (int j = 0; j < W; j++){
			cin >> a[i][j];
			cnt[a[i][j] - 'a']++;
		}

	// 4
	int c4 = (H / 2) * 2 * (W / 2) * 2;
	// 1
	int c1 = (H % 2) * (W % 2);
	// 2
	int c2 = H*W - c1 - c4;

	// 奇数のものはc1個
	int odd = 0;
	rep(i, 26)
		if (cnt[i] % 2 == 1){
			odd++;
			cnt[i]--;
		}
	if (odd != c1){
		cout << "No" << endl;
		return 0;
	}
	// 4
	int four = 0;
	rep(i, 26){
		four += (cnt[i] / 4) * 4;
	}
	if (four < c4){
		cout << "No" << endl;
		return 0;
	}

	// 2
	rep(i, 26){
		if (cnt[i] % 2 != 0){
			cout << "No" << endl;
			return 0;
		}
	}

	cout << "Yes" << endl;

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int s[110];
void shunxushuchu(int a[],int n){
   int i;
   for(i=0;i<n;i++){
    if(i>0)printf(" ");
    printf("%d",a[i]);
   }printf("\n");
}
void charupaixu(int a[],int n){
  int j,i,v;
  for(i=1;i<n;i++){
    v=a[i];
    j=i-1;
    while(j>=0&&a[j]>v){
        a[j+1]=a[j];
        j--;
    }a[j+1]=v;
    shunxushuchu(a,n);
  }
}
int main(){
    int n,i;
    scanf("%d",&n);
    for(i=0;i<n;i++)scanf("%d",&s[i]);
    shunxushuchu(s,n);
    charupaixu(s,n);
return 0;
}

Measured memory_bytes: 604
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
int main(void){
    ll n,d,ans=0;
    cin>>n>>d;
    rep(0,i,n){
        ll a,b;
        cin>>a>>b;
        if(a*a+b*b<=d*d)++ans;
    }
    cout<<ans;
}


Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;

int main() {
    int N;
    cin >> N;
    int ans=0,count=0;
    int p[N],q[N],l[N],m[N];
    for (int i = 0; i < N; ++i) {
      cin>>p[i];
      q[i]=i+1;
    }
    int j=0;
    for (int i = 0; i < N; ++i) {
      if(p[i]!=q[i]){
        count++;
        l[j]=i+1;
        m[j]=p[i];
        j++;
      }
    }
    if(count==0) cout << "YES" << endl;
    else if(count==2) {
      if(l[0]==m[1] && l[1]==m[0]) cout << "YES" << endl;
      else cout << "NO" << endl;
    }
    else cout << "NO" << endl;
   return 0;
 }

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

int main() {
  string s;
  cin >> s;
  int n = s.size();
  bool ans = true;
  rep(i, (n - 1) / 2) {
    if(s.at(i) != s.at(n - 1 - i)) ans = false;
  }
  rep(i, (n + 3) / 4 - 1) {
    if(s.at(i) != s.at((n - 1) / 2 - 1 - i)) ans = false;
  }
  if(ans == true) cout << "Yes" << endl;
  else cout << "No" << endl;
} 


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

using namespace std;

const int ms = 1e5 + 17;
const int mod = 1e9 + 7;

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

    int n;
    cin >> n;

    vector<int> v(n, 0);

    for(int i = 0; i < n; ++i)
        cin >> v[i];

    long long l = -1e9, r = 1e9, curans = 1e9 + 1;

    while(l <= r)
    {
        long long mid = (l + r) / 2;

        vector<int> b(n, 0);

        for(int i = 0; i < n; ++i)
            b[i] = mid + i + 1;

        int k1 = 0, k2 = 0;

        for(int i = 0; i < n; ++i)
        {
            if(v[i] >= b[i])
                ++k1;
            else
                ++k2;
        }


        if(k1 < k2)
            r = mid - 1;
        else
        {
            curans = mid;
            l = mid + 1;
        }

    }

    long long sum = 0;

    for(int i = 0; i < n; ++i)
    {
        sum += abs(v[i] - (curans + (i + 1)));
    }

    cout << sum << '\n';

  /*  long long sum = 0;

    for(int i = 0; i < n; ++i)
        sum += v[i];

    sum -= (n * (n + 1)) / 2;

    long long l = -1e9, r = 1e9, curans = 1e9 + 1;

    while(l <= r)
    {
        long long mid = (l + r) / 2;

        long long t = sum - n * mid;

        if((sum - n * mid) )
    }*/


}


Measured memory_bytes: 1800
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
#define REREASE

#define _GLIBCXX_DEBUG
#ifdef DEBUG
#define s(...) show(__VA_ARGS__);
#define sl(...) show(__VA_ARGS__);cout<<endl;
#else
#define s(...)
#define sl(...)
#endif
void show() {}
template <class Head,class... Args>void show(Head t,Args... args){std::cout<<t<<" ";show(args...);}
#define REP(i, n) for(ll i = 1; i <= n; i++)
#define REPR(i, n) for(ll i = n; i >= 1; i--)
#define FOR(i, m, n) for(ll i = m; i <= n; i++)
#define INF 1e9+123
#define ALL(v) v.begin(), v.end()

int main(){
    ll N;
    cin>>N;
    map<string,int> t{};
    REP(i,N){
        string n;
        cin>>n;
        t[n]=0;
    }
    cout<<t.size();
    //if(equal(D.begin(), D.end()-1, K.begin()))cout<<"Yes";else cout<<"No";
    return 0;
}


Measured memory_bytes: 19216
n = int(input())
a = []
for _ in range(n):
	a.append(int(input()))

b = sorted(a, reverse = True)

if(b[0]==b[1]):
	for _ in range(n):
		print(b[0])
else:
	for i in a:
		if(i==b[0]):
			print(b[1])
		else:
			print(b[0])





Measured memory_bytes: 14112
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <numeric>
#include <iomanip>
#include <map>
#include <set>
#include <deque>
#include <utility>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define MOD 1e9 + 7
#define INF 1e9
#define PIE 3.14159265358979323

template <class T>
inline bool chmin(T &a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T>
inline bool chmax(T &a, T b) {if (a < b) {a = b; return true;} return false;}
template <class T>
T GCD(T a, T b) {if (b == 0) return a; else return GCD(b, a % b);}
template <class T>
inline T LCM(T a, T b) { return (a * b) / GCD(a, b);}

int main(){
    string s, t;
    cin >> s >> t;
    bool flag = true;
    for (int i = 0; i < s.size();i++){
        if (s[i] != t[i]){
            flag = false;
        }
    }
    if (s.size() + 1 != t.size())
        flag = false;
    if (flag){
        cout << "Yes" << endl;
    }
    else
        cout << "No" << endl;
}

Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
#define int long long 
int32_t main()
{
    int x;
    cin>>x;
    int y=360;
    int z=__gcd(x,y);
    int res=(x*y)/z;
    res=res/x;
    cout<<res<<"\n";
}

Measured memory_bytes: 3604
#include<iostream>
using namespace std;
int main() {
    int h, w;
    while (1) {
        cin >> h >> w;
        if (h == 0 && w == 0) break;
        for (int i=0; i<h; i++) {
            if (i==0 || i==h-1) {
                for (int j=0; j<w; j++) {
                    cout << "#";
                }
                cout << endl;
            } else {
                for (int k=0; k<w; k++) {
                    if (k==0 || k==w-1) {
                        cout << "#";
                    } else {
                        cout << ".";
                    }
                }
                cout << endl;
            }
        }
        cout << endl;
    }
    return 0;
}


Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll dp[102][100005];
ll knapsack1(ll w[],ll v[],int n,int W)
{
    if(w==0||n==0)
    return 0;
    if(dp[n][W]!=-1)
    return dp[n][W];
    if(w[n-1]>W)
    return dp[n][W]=knapsack1(w,v,n-1,W);
    else
    return dp[n][W]=max(knapsack1(w,v,n-1,W-w[n-1])+v[n-1],knapsack1(w,v,n-1,W));
}
int main()
{
	memset(dp,-1,sizeof(dp));
	ll n,i,w[100005],v[100005],W;
	cin>>n>>W;
	for(i=0;i<n;i++)
	cin>>w[i]>>v[i];
	cout<<knapsack1(w,v,n,W);
	return 0;
}

Measured memory_bytes: 83216
a = input()
b = input()
c = input()
sa = [a[i] for i in range(len(a))]
sb = [b[i] for i in range(len(b))]
sc = [c[i] for i in range(len(c))]
next = a[0]
while True:
    if next == 'a':
        if len(sa) == 0:
            print("A")
            exit(0)
        next = sa[0]
        sa.pop(0)
    if next == 'b':
        if len(sb) == 0:
            print("B")
            exit(0)
        next = sb[0]
        sb.pop(0)
    if next == 'c':
        if len(sc) == 0:
            print("C")
            exit(0)
        next = sc[0]
        sc.pop(0)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int ans,k,n;
int main()
{
    cin>>n>>k;
    ans=k;
    for(int i=2;i<=n;i++)
    {
        ans*=k-1;
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 256
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#define all(x) (x).begin(),(x).end()

void solve(){

}
int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    ll sum = 0;
    for (int i = 0; i < N; i++){
        cin >> a[i];
        sum += a[i]-1;
    }
    cout << sum << endl;
    

    return 0;
}


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

void solve() {
    string s;
    cin >> s;
    if(s == "ABC") cout << "ARC";
    else cout << "ABC";
}   

int main() {
    ios_base :: sync_with_stdio(false); 
    cin.tie(NULL);
    ll t = 1;
    //cin >> t;
    while(t--) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3600
n,k=map(int, input().split())
p=0
import math
for i in range(1, n+1):
    if i < k/2:
        pi = math.ceil(math.log2(k/i))
        p += (1/n)*((0.5)**pi)
    elif i >= (k/2) and i < k:
        p += (1/n)*0.5
    else:
        p+= 1/n 

print(p)


Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

int main(){

    ll n; cin>>n;
    
    if(n<=6){
        cout<<1<<endl;
        return 0;
    }
    
    if(n<=11){
        cout<<2<<endl;
        return 0;
    }
    
    ll ans = (n/11)*2;
    n%=11;
    
    if(n==0){
        cout<<ans<<endl;
        return 0;
    }
    
    if(n<=6){
        cout<<ans+1<<endl;
        return 0;
    }
    
    cout<<ans+2<<endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
double arr[3001],n;
double dp[3001][3001];
const double eps=1e-15;

double f(int pos,int cnt){
	if(pos==0){
		if(cnt==0)return 1.0;return 0.0;
		return cnt==0;
	}
	double &res=dp[pos][cnt];
	if(!(fabs(res+1)<eps))return res;
	res=0;
	if(cnt>0)res+=(f(pos-1,cnt-1)*(1.0-arr[pos]));
	res+=(f(pos-1,cnt)*arr[pos]);
	return res;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	for(int i=0;i<3001;i++)for(int j=0;j<3001;j++)dp[i][j]=-1;
	cin>>n;
	for(int i=1;i<=n;i++)cin>>arr[i];
	double ans=0;
	for(int i=0;2*i<n;i++){
		ans+=f(n,i);
	}
	cout<<setprecision(10)<<fixed<<ans<<endl;



	return 0;
}

Measured memory_bytes: 70784
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;
int main()
{
  int N;
  cin >> N;
  map<int, int> a;
  int mini = 0;
  rep(i, N)
  {
    int tmp;
    cin >> tmp;
    if (tmp >= 3200)
    {
      mini++;
    }
    else
    {
      a[tmp / 400]++;
    }
  }
  int Min = max(1, (int)a.size());
  int maxi = a.size() + mini;
  cout << Min << " " << maxi << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <stdio.h>
#include <cstdio>
#include <cstring>
#include <math.h>
#include <list>
#include <numeric>

using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; i++)
#define rep(i,b) Rep(i,0,b)
#define rrep(i,a) for(int i = a; i >= 0; i--)
#define allof(a) (a).begin(), (a).end()

typedef long long ll;
const int inf = 1e9 + 7;
const ll infll = 1ll << 60ll;
const ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

/*
// 最大公約数
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, W;
	cin >> n >> W;
	vector<ll> w(n), v(n);
	ll baseWeight = inf;
	rep(i, n) {
		cin >> w[i] >> v[i];
		baseWeight = min(baseWeight, w[i]);
	}
	// w1 <= wi <= w1 + 3
	// wは4パターンしか値を持たない

	ll maxW = accumulate(allof(w), 0);
	if (maxW <= W) {
		cout << accumulate(allof(v), 0) << endl;
		return 0;
	}

	// wsumの取りうる値は？
	// w1 * i <= wsum <= (w1 + 3) * i
	rep(i, n) {
		w[i] -= baseWeight;
	}
	maxW -= baseWeight * n;
	// dp[i][j][k] := i番目までの商品を見て重さがjでありk個選んだ時の価値
	vector<vector<vector<ll>>> dp(100 + 10, vector<vector<ll>>(500 + 10, vector<ll>(100 + 10, -1)));
	rep(i, 110) {
		dp[i][0][0] = 0;
	}

	rep(i, n) {
		rep(j, 510) {
			rep(k, n) {
				if (j - w[i] >= 0 && k < n) {
					dp[i + 1][j][k + 1]  = max(dp[i + 1][j][k + 1], dp[i][j - w[i]][k] + v[i]);
				}
				dp[i + 1][j][k] = max(dp[i + 1][j][k], dp[i][j][k]);
			}
		}
	}

	ll ans = 0;
	rep(i, n + 1) {
		for (ll j = 509; j >= 0; j--) {
			rep(k, n + 1) {
				if (dp[i][j][k] != -1 && j + (ll)k * baseWeight <= W) {
					ans = max(ans, dp[n][j][k]);
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 51072
#include <stdio.h>
#include <string.h>

int main(void){
    int i;
    
    int n;
    int h[100000];
    scanf("%d", &n);
    
    for (int i = 0; i < n; i++) {
        scanf("%d", &h[i]);
    }
    
    
    int flag = 1;
    int current_tall = h[n-1];
    for (int i = n - 2; i >= 0; i--){
        if (h[i] <= current_tall){
            current_tall = h[i];
        }
        if (h[i] == current_tall + 1){
            continue;
        }
        if (h[i] > current_tall + 1){
            flag = 0;
            break;
        }
    }
    
    if (flag == 1){
        printf("Yes");
    }
    else{
        printf("No");
    }
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ld = long double;
using point = complex<ld>;

const ld eps = 1e-10;
const ld INF = 1e9;

struct edge {
	int to, cap;
	ld cost;
	int rev;
	edge(int to_, int cap_, ld cost_, int rev_)
		: to(to_), cap(cap_), cost(cost_), rev(rev_) {}
};

const int MAX = 10000;

int V;

vector<edge> G[MAX];
ld h[MAX], dist[MAX];
int prevv[MAX], preve[MAX];

void add(int from, int to, int cap, ld cost) {
	G[from].emplace_back(to, cap, cost, G[to].size());
	G[to].emplace_back(from, 0, -cost, G[from].size() - 1);
}

ld calc(int s, int t, int f) {
	using pii = pair<ld, int>;
	ld res = 0;
	fill(h, h + V, 0);
	while (f > 0) {
		priority_queue<pii, vector<pii>, greater<pii>> que;
		fill(dist, dist + V, INF);
		dist[s] = 0;
		que.emplace(0, s);
		while (!que.empty()) {
			pii p = que.top(); que.pop();
			int v = p.second;
			if (dist[v] < p.first) continue;
			for (size_t i = 0; i < G[v].size(); i++) {
				edge &e = G[v][i];
				if (e.cap > 0 && dist[e.to] > dist[v] + e.cost + h[v] - h[e.to] + eps) {
					dist[e.to] = dist[v] + e.cost + h[v] - h[e.to];
					prevv[e.to] = v;
					preve[e.to] = i;
					que.emplace(dist[e.to], e.to);
				}
			}
		}
		assert(dist[t] < INF / 2);
		for (int v = 0; v < V; v++)
			h[v] += dist[v];
		int d = f;
		for (int v = t; v != s; v = prevv[v]) {
			d = min(d, G[prevv[v]][preve[v]].cap);
		}
		f -= d;
		res += d * h[t];
		for (int v = t; v != s; v = prevv[v]) {
			edge &e = G[prevv[v]][preve[v]];
			e.cap -= d;
			G[v][e.rev].cap += d;
		}
	}
	return res;
}

int main()
{
	ios::sync_with_stdio(false), cin.tie(0);
	cout << fixed << setprecision(10);
	int n;
	cin >> n;
	int sx, sy;
	cin >> sx >> sy;
	point s(sx, sy);
	ld res = 0;
	vector<point> f(n), t(n);
	for (int i = 0; i < n; i++) {
		int x, y;
		cin >> x >> y;
		f[i] = point(x, y);
		cin >> x >> y;
		t[i] = point(x, y);
		res += abs(f[i] - t[i]);
	}
	V = n * 2 + 2;
	int src = n * 2, sink = n * 2 + 1;
	for (int i = 0; i < n; i++) {
		add(src, n + i, 1, 0);
		add(i, sink, 1, 0);
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			add(n + i, j, 1, abs(t[i] - f[j]));
		}
	}
	res += calc(src, sink, n);
	cout << res << endl;
	return 0;
}



Measured memory_bytes: 15336
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>

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

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );}
int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;}
int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);}

int main(void){
 
    int n, a, b;
    
    scanf("%d", &n);
    if (n==1) {
        printf("Hello World");
    } else {
        scanf("%d%d", &a, &b);
        printf("%d", a+b);
    }
    
    return 0;
}



Measured memory_bytes: 1720
h, w = map(int, input().split())
a = []
for i in range(h):
    x = input()
    if x == '.'*w:
        continue
    a.append(list(x))

for i in range(w):
    t = True
    length = len(a)
    for j in range(length):
        if a[j][i] != '.':
            t = False
            break
    if t:
        for k in a:
            k[i] = 'D'


for i in a:
    for j in i:
        if j != 'D':
            print(j, end='')

    print()


Measured memory_bytes: 4596
#include <iostream>
#include <stdio.h>
#define _USE_MATH_DEFINE_
#include <math.h>
using namespace std;

int main()
{
    double r;

    cin >> r;

    printf("%f %f\n", r * r * M_PI, 2 * M_PI * r);

    return 0;
}

Measured memory_bytes: 1232
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;

namespace CSharp
{
    static class Program
    {
        static void Main(string[] args)
        {
            int n = ReadInt();

            long ans = 0;
            for (int i = 1; i <= n; i++)
            {
                if (i % 3 != 0 && i % 5 != 0)
                {
                    ans += i;
                }
            }

            Console.WriteLine(ans);
        }

        #region Helpers

        static int[] ReadIntArray() => Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        static long[] ReadLongArray() => Console.ReadLine().Split().Select(s => long.Parse(s)).ToArray();

        static int[] ReadLineIntArray(int count) => Enumerable.Repeat(0, count).Select(_ => int.Parse(Console.ReadLine())).ToArray();
        static long[] ReadLineLongArray(int count) => Enumerable.Repeat(0, count).Select(_ => long.Parse(Console.ReadLine())).ToArray();

        static string ReadString() => Console.ReadLine();
        static int ReadInt() => int.Parse(Console.ReadLine());
        static long ReadLong() => long.Parse(Console.ReadLine());

        static void ReadInt(out int first)
        {
            var array = ReadIntArray();
            first = array[0];
        }

        static void ReadInt(out int first, out int second)
        {
            var array = ReadIntArray();
            first = array[0];
            second = array[1];
        }

        static void ReadInt(out int first, out int second, out int third)
        {
            var array = ReadIntArray();
            first = array[0];
            second = array[1];
            third = array[2];
        }

        static void ReadInt(out int first, out int second, out int third, out int fourth)
        {
            var array = ReadIntArray();
            first = array[0];
            second = array[1];
            third = array[2];
            fourth = array[3];
        }

        static void ReadLong(out long first)
        {
            var array = ReadLongArray();
            first = array[0];
        }

        static void ReadLong(out long first, out long second)
        {
            var array = ReadLongArray();
            first = array[0];
            second = array[1];
        }

        static void ReadLong(out long first, out long second, out long third)
        {
            var array = ReadLongArray();
            first = array[0];
            second = array[1];
            third = array[2];
        }

        static void ReadLong(out long first, out long second, out long third, out long fourth)
        {
            var array = ReadLongArray();
            first = array[0];
            second = array[1];
            third = array[2];
            fourth = array[3];
        }

        static string YesNo(bool condition) => condition ? "Yes" : "No";
        static string YESNO(bool condition) => condition ? "YES" : "NO";

        #endregion
    }
}

Measured memory_bytes: 27484
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;

int main() {
	int i, j, c = 0;
	string S;
	cin >> S;
	for (i = 0; i <= 3; i++) {
		for(j=0;j<=3;j++)
			if (S[j] == S[i])
				c++;
	}
	if (c == 8)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	return 0;
}

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

namespace ABC49
{
    static class Program
    {
        private static uint n;

        static void Main(string[] args)
        {
            var line = Console.ReadLine();
            var firstSpaceIndex = line.IndexOf(' ');
            var secondSpaceIndex = line.IndexOf(' ', firstSpaceIndex + 1);
            n = ParseInt(line.Remove(firstSpaceIndex));
            var k = ParseInt(line.Substring(firstSpaceIndex + 1, secondSpaceIndex - firstSpaceIndex - 1));
            var l = ParseInt(line.Substring(secondSpaceIndex + 1));

            var roadsTree = ReadRoads(k);
            var railsTree = ReadRoads(l);

            var groups = new ulong[n];

            for (uint i = 0; i < n; i++)
            {
                var roadRoot = FindRoot(roadsTree, i);
                var railRoot = FindRoot(railsTree, i);
                var key = (ulong)roadRoot << 32 | railRoot;
                groups[i] = key;
            }

            Array.Sort(groups);

            var result = new uint[n];

            for (uint i = 0; i < n; i++)
            {
                var key = (ulong)roadsTree[i] << 32 | railsTree[i];
                var startIndex = Array.BinarySearch(groups, key);

                uint count = 1;
                for (var j = startIndex + 1; j < n; j++)
                {
                    if (groups[j] == key) count++;
                    else break;
                }
                for (var j = startIndex - 1; j >= 0; j--)
                {
                    if (groups[j] == key) count++;
                    else break;
                }
                result[i] = count;
            }

            Console.WriteLine(string.Join(" ", result));
        }

        private static uint ParseInt(string s)
        {
            return uint.Parse(s, NumberFormatInfo.InvariantInfo);
        }

        private static uint[] ReadRoads(uint count)
        {
            var roads = new uint[n];
            for (uint i = 0; i < n; i++)
                roads[i] = i;

            for (uint i = 0; i < count; i++)
            {
                var line = Console.ReadLine();
                var spaceIndex = line.IndexOf(' ');
                var x = FindRoot(roads, ParseInt(line.Remove(spaceIndex)) - 1);
                var y = FindRoot(roads, ParseInt(line.Substring(spaceIndex + 1)) - 1);
                if (x != y) roads[y] = x;
            }

            return roads;
        }

        private static uint FindRoot(uint[] tree, uint x)
        {
            return tree[x] == x
                ? x
                : tree[x] = FindRoot(tree, tree[x]);
        }
    }
}


Measured memory_bytes: 14384
#include<iostream>

using namespace std;

int main() {
	int W, H, x, y, r;
	cin >> W >> H >> x >> y >> r;

	if (x + r <= W && y + r <= H && x >= r && y >= r) {
		cout << "Yes" << endl;
	}
	else cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 3096
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  int n;
  cin >> n;
  int k[n][n];
  rep(i,n){
    int u;
    cin >> u;
    rep(j,u){
      int a,b;
      cin >> a >> b;
      if(b==0)k[i][a-1]=3;
      if(b==1)k[i][a-1]=2;
    }
  }
  int o=(1<<n);
  int Max=0;
  int con=0;
  rep(i,o){
    rep(j,n){
      if(con==1)break;
      if(i&(1<<j)){
        rep(q,n){
          if(i&(1<<q)){
            if(k[j][q]==3)con=1;
          }
          else if(k[j][q]==2)con=1;
        }
      }
    }
    if(con==1){
      con=0;
      continue;
    }
    int cnt=0;
    rep(j,n){
      if(i&(1<<j))cnt++;
    }
    Max=max(Max,cnt);
  }
  cout << Max << endl;
}


Measured memory_bytes: 256