akhauriyash/Code-Regression huggingface dataset:
/*
CF ID: Ankit717
PROG: knapsack1
LANG: C++
*/
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> pll;
#define mod 1000000007
#define maxn 200005
#define f(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rf(i,a,b) for(ll i=(ll)(a);i>=(ll)(b);i--)
#define pb push_back
#define pf push_front
#define nl cout << "\n";

const ll INF=1e18L+5;
 
struct Data{
	ll p;
	ll h;
};

void ini(){
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
}

bool comp(pll &a,pll &b){
	// if(a.first==b.first){
	// 	return a.second<b.second;
	// }else{
		return a.first>b.first;
	//}
}

// vector<pll> adj[maxn];
// vector<ll> par;
// vector<bool> vis;

ll gcd(ll a,ll b){
    while(a!=0){
        ll temp=a;
        a = b % a;
        b = temp;
    }

    return b;
}

// bool prime[maxn],near[maxn];
// void sieve(){
// 	f(i,0,maxn+1){
// 		prime[i]=true;
// 	}
// 	prime[0]=falsrime[1]=false;
// 	for(ll i=2;i*i<=maxn;i++){
// 		if(prime[i]){
// 			for(j=i*i;j<=maxn;j+=i){
// 				prime[j]=false;
// 			}
// 		}
// 	}
// }

ll dp[105][maxn];
ll knapsack(ll n,ll *w,ll *v,ll weight){
	if(n==0){
		return dp[n][weight]=0;
	}else if(dp[n][weight]!=-1){
		return dp[n][weight];
	}else{
		if(weight-w[n-1]<0){
			return dp[n][weight]=knapsack(n-1,w,v,weight);
		}else{
			return dp[n][weight]=max(knapsack(n-1,w,v,weight-w[n-1])+v[n-1],knapsack(n-1,w,v,weight));
		}
	}
}

void solve(){
	ll n,W;
	cin >> n >> W;
	ll w[n],v[n];
	f(i,0,n){
		cin >> w[i] >> v[i];
	}

	memset(dp,-1,sizeof(dp));



	cout << knapsack(n,w,v,W);

}

int main(){
	ini();
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	
    
	// ll t;
	// cin >> t;
	// f(i,0,t){
		solve();
	//}
}


Measured memory_bytes: 167696
/*
  GOOD is not Enough
  You've got to be GREAT.
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
// #include<boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define mod 1000000007
#define FAST ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f(i,n) for(int i=0;i<n;i++)
#define fp(i,k,n) for(int i=k;i<=n;i++)
#define fr(i,k,n) for(int i=k;i>=n;i--)
#define pb push_back
#define pii pair<int,int>
#define dbg(x) cout << (#x) << " is " << (x) << '\n' 
#define F first
#define S second
#define all(a) a.begin(),a.end()
typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;

void solve()
{ 
  string s,t;
  cin >> s >> t;
  int x=(int)s.length();
  int y=(int)t.length();
  if(y==x+1)
  {
      s.pb(t[y-1]);
      if(t==s)
        cout << "Yes\n";
      else
       cout << "No\n";
  }
  else
   cout << "No\n"; 
  return;
}

signed main()
{
  FAST
  int T=1;
  // cin >> T;
  while(T--)
  {
    solve();
  }
  return 0;
}

Measured memory_bytes: 3644
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

int n, m;
int cnt[1010];

bool intersect(pair<int, int> lhs, pair<int, int> rhs) {
  if (lhs.first <= rhs.first && rhs.first <= lhs.second) { return true; }
  if (rhs.first <= lhs.first && lhs.first <= rhs.second) { return true; }
  return false;
}

int main() {
  while (scanf("%d %d", &n, &m) > 0) {
    MEMSET(cnt, 0);
    REP(i, m) {
      int x, y;
      scanf("%d %d", &x, &y);
      if (x > y) { continue; }
      x--; y--;
      cnt[x]++;
      cnt[y]--;
    }
    int prev = -1;
    int ans = n + 1;
    int sum = 0;
    REP(i, n) {
      if (sum == 0 && cnt[i] > 0) {
        prev = i;
      } else if (sum > 0 && sum + cnt[i] == 0) {
        ans += 2 * (i - prev);
      }
      sum += cnt[i];
    }
    assert(sum == 0);
    printf("%d\n", ans);
  }
}

Measured memory_bytes: 1196
#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define dbg(x) cerr<<#x": "<<(x)<<endl
#define dbg_p(x) cerr<<#x": "<<(x).first<<' '<<(x).second<<endl
#define dbg_v(x, n) {cerr<<#x"[]: ";for(long long _=0;_<n;++_)cerr<<(x)[_]<<' ';cerr<<endl;}
#define all(v) v.begin(), v.end()
#define fi first
#define se second

template<typename T1, typename T2>
ostream& operator <<(ostream &out, const pair<T1, T2> &item) {
	out << '(' << item.first << ", " << item.second << ')';
	return out;
}

template <typename T>
ostream& operator <<(ostream &out, const vector<T>& v) {
	for(const auto &item : v) out << item << ' ';
	return out;
}

const int N = 110;

int a[N];

int main()
{
	ios_base::sync_with_stdio(false);

	int k, t;

	cin >> k >> t;

	int s = 0;
	for(int i = 0; i < t; ++i) cin >> a[i], s += a[i];
	sort(a, a + t);

	int ans = max(0, a[t - 1] - (s - a[t - 1]) - 1);

	cout << ans << '\n';

	return 0;
}


Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<double,double>pdd;
#define int ll
using pii = pair<int, int>;
signed main(){
    int h,w;
    cin>>h>>w;
    int ans=INF;
    if(h%3==0){
        return puts("0")*0;
    }else if(h%3==1)ans=w;
    else ans=w;
    if(w%3==0){
        return puts("0")*0;
    }else if(w%3==1)cmin(ans,h);
    else cmin(ans,h);
    
    pii nw;
    for(int i=1; i<w;i++){
        nw.first=max(i,w-i);
        nw.second=min(i,w-i);
       // cout<<nw.first<<" "<<nw.second<<" "<<ans<<endl;
        cmin(ans,abs(max({h*nw.second,((int)(h/2))*nw.first,((int)(h/2+h%2))*nw.first})-min({h*nw.second,((int)(h/2))*nw.first,((int)(h/2+h%2))*nw.first})));
    }
    //cout<<ans<<endl;
    swap(h, w);
    for(int i=1; i<w;i++){
        nw.first=max(i,w-i);
        nw.second=min(i,w-i);
        cmin(ans,abs(max({h*nw.second,((int)(h/2))*nw.first,((int)(h/2+h%2))*nw.first})-min({h*nw.second,((int)(h/2))*nw.first,((int)(h/2+h%2))*nw.first})));
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main
{
    PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer tok;

    public void go() throws IOException
    {
        ntok();
        int n = ipar();
        long sum = 0;
        for (int i = 1; i <= n; i++) {
            if (i % 3 != 0 && i % 5 != 0) {
                sum += i;
            }
        }
        out.println(sum);

        out.flush();
        in.close();
    }

    public void ntok() throws IOException
    {
        tok = new StringTokenizer(in.readLine());
    }

    public int ipar()
    {
        return Integer.parseInt(tok.nextToken());
    }

    public int[] iapar(int n)
    {
        int[] arr = new int[n];
        for (int i = 0; i < n; i++)
        {
            arr[i] = ipar();
        }
        return arr;
    }

    public long lpar()
    {
        return Long.parseLong(tok.nextToken());
    }

    public long[] lapar(int n)
    {
        long[] arr = new long[n];
        for (int i = 0; i < n; i++)
        {
            arr[i] = lpar();
        }
        return arr;
    }

    public double dpar()
    {
        return Double.parseDouble(tok.nextToken());
    }

    public String spar()
    {
        return tok.nextToken();
    }

    public static void main(String[] args) throws IOException
    {
        new Main().go();
    }
}


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

using namespace std;

int main() {
	int K;
	string S;
	cin >> K >> S;
	if (S.size() > K) {
		S = S.substr(0, K);
		cout << S << "..." << endl;
	} else {
		cout << S << endl;
	}
}


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


bool solve(int n, int a, int b) {
    a--; b--;

    return (b - a) % 2 == 0;
}

int main() {
#ifdef HOME
    freopen("in", "r", stdin);
#endif

    int n, a, b;
    while (cin >> n >> a >> b) {
        string s = solve(n, a, b) ? "Alice" : "Borys";
        cout << s << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
const ll LL_MAX=LLONG_MAX;

struct In{
    template<typename T>
    operator T(){
        T x;
        cin >> x;
        return x;
    }
};
In in;

template <typename T,typename U>
void forin(T* x,U n){
    for (U i=0;i<n;i++) cin >> x[i];
}

template <typename T>
int div1(T x) {
    return x%1000000007;
}

template <typename T>
void out(T x){
    cout << x << endl;
}

template <typename T>
T gcd(T x,T y){
    if (y == 0) return x;
    return gcd(y,x%y);
}

template <typename T>
T lcm(T x,T y){
    return x*y/gcd(x,y);
}

int main(){
    int x=in,y=in,z=in;
    cout << z << ' ' << x << ' ' << y << endl;
}

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

//#include <atcoder/all>

using namespace std;
//using namespace atcoder;

//#define int long long
#define ll long long

ll INF = (1LL << 60);
int mod = 998244353;
using P = pair<ll, ll>;

signed main() {
	string s; cin >> s;
	map<int, int>mp;
	for (int i = 0; i < s.size(); i++) {
		mp[s[i]]++;
	}
	bool ok = true;
	if (mp.size() == 2) {
		for (auto p : mp) {
			if (p.second != 2)ok = false;
		}
	}
	else {
		ok = false;
	}
	if (ok)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}



Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int>P;
#define PI 3.14159265359
#define MOD 1000000007
const int MAX =510000;
int main(){
  	int k,a,b;
  	cin >>k>>a>>b;
  	int flag=0;
  	for(int i=1;i<=1000;i++){
    	if(a<=k*i&&k*i<=b){flag=1;}
    }
  	if(flag==1){cout<<"OK"<<endl;}
  	else{cout<<"NG"<<endl;}
}


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

namespace AtCorder
{
	public class Program
	{
		static void Main(string[] args)
		{
			Scanner cin = new Scanner();
			int n = cin.Int();
			int k = cin.Int();
			int[] p = cin.ArrayInt(n);


			var count = new int[n];
			var ss = new SortedSet<int>();
			for (int i = 0; i < k; i++) {
				ss.Add(p[i]);
				count[p[i]]++;
			}

			int noSort = 0;
			int ren = 0;
			int pp = -1;
			var ni = new bool[n];
			for (int i = 0; i < n; i++) {
				if (p[i] >= pp) {
					ren++;
					if (ren >= k) {
						noSort++;
						ni[i] = true;
					}
				} else {
					ren = 1;
				}

				pp = p[i];
			}

			int ans = 1;
			bool isNoSort = ni[k - 1];
			for (int i = k; i < n; i++) {
				int prev = ss.Min;
				count[p[i - k]]--;
				if (count[p[i - k]] == 0) {
					ss.Remove(p[i - k]);
				}

				ss.Add(p[i]);
				count[p[i]]++;

				if (p[i - k] != prev) {
					if (ni[i]) {
						if (isNoSort == false) {
							++ans;
						}

						isNoSort = true;
					} else {
						++ans;
					}
					
					continue;
				}

				int next = ss.Max;
				if (p[i] != next) {
					if (ni[i]) {
						if (isNoSort == false) {
							++ans;
						}

						isNoSort = true;
					} else {
						++ans;
					}

					continue;
				}
			}

			Console.WriteLine(ans);
		}
	}

	public class Scanner
	{
		private readonly char[] delimiter_ = new char[] { ' ' };
		private string[] buf_;
		private int index_;

		public Scanner()
		{
			buf_ = new string[0];
			index_ = 0;
		}

		public string Next()
		{
			if (index_ < buf_.Length) {
				return buf_[index_++];
			}

			string st = Console.ReadLine();
			while (st == "") {
				st = Console.ReadLine();
			}

			buf_ = st.Split(delimiter_, StringSplitOptions.RemoveEmptyEntries);
			if (buf_.Length == 0) {
				return Next();
			}

			index_ = 0;
			return buf_[index_++];
		}

		public int Int()
		{
			return int.Parse(Next());
		}
		public int[] ArrayInt(int N, int add = 0)
		{
			int[] Array = new int[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Int() + add;
			}
			return Array;
		}

		public long Long()
		{
			return long.Parse(Next());
		}

		public long[] ArrayLong(int N, long add = 0)
		{
			long[] Array = new long[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Long() + add;
			}
			return Array;
		}

		public double Double()
		{
			return double.Parse(Next());
		}

		public double[] ArrayDouble(int N, double add = 0)
		{
			double[] Array = new double[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Double() + add;
			}
			return Array;
		}
	}
}

Measured memory_bytes: 40492
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

/*const int MM = 4e8;
int mpos = 0;
char mem[MM];
inline void * operator new ( size_t n )
{
	char *res = mem + mpos;
	mpos += n;
	return (void *)res;
}
inline void operator delete ( void * ) { } */

#define TIME (clock() * 1.0 / CLOCKS_PER_SEC)

const ld pi = acos(-1.0);
const ll INF = 1e18 + 239;
const int BIG = 1e9 + 239;
const ll MOD = 1e9 + 7;
const ll MOD2 = MOD * MOD;
const int M = 2 * 1e5 + 239;
const int N = 2 * 1e3 + 239;
const int X = 1e2 + 10;
const int L = 18;
const int T = (1 << 18);
const int two = 2;
const int th = 3;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

bool used[X];
int n, d[X], mx[X];
ll sz[X], sum[X];
vector<vector<int> > v;
vector<pair<int, int> > r;

pair<int, ll> solve()
{
    int kol = 0;
    for (int i = 0; i < n; i++)
        kol = max(kol, d[i] + 1);
    memset(mx, 0, sizeof(mx));
    memset(sz, 0, sizeof(sz));
    memset(sum, 0, sizeof(sum));
    for (int i = 0; i < n; i++)
    {
        sz[d[i]]++;
        sum[d[i]] += v[i].size();
        mx[d[i]] = max(mx[d[i]], (int)v[i].size());
    }
    for (int i = 0; i < kol; i++)
    {
        ll pl = sz[i] * mx[i] - sum[i];
        sz[i + 1] += pl;
        sum[i + 1] += pl;
    }
    return make_pair(kol, sz[kol - 1]);
}

void dfs(int p, int c)
{
    used[p] = true;
    d[p] = c;
    for (int i : v[p])
        if (!used[i])
            dfs(i, c + 1);
}

int main()
{   /*
    freopen("test.in", "r", stdin);
    freopen("test.out", "w", stdout); /**/
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    v.resize(n);
    for (int i = 0; i < n - 1; i++)
    {
        int s, f;
        cin >> s >> f;
        s--, f--;
        v[s].push_back(f);
        v[f].push_back(s);
        r.push_back(make_pair(s, f));
    }
    pair<int, ll> ans = make_pair(BIG, 0);
    for (int i = 0; i < n; i++)
    {
        memset(used, 0, sizeof(used));
        dfs(i, 0);
        ans = min(ans, solve());
    }
    for (pair<int, int> t : r)
    {
        int s = t.first;
        int f = t.second;
        memset(used, 0, sizeof(used));
        used[s] = true;
        used[f] = true;
        dfs(s, 0);
        dfs(f, 0);
        ans = min(ans, solve());
    }
    cout << ans.first << " " << ans.second;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#include<numeric>
#include<iomanip>
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define ll long long

using namespace std;

//最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) {
		return a;
	}
	return gcd(b, a % b);
}

//最小公倍数
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}

//階乗
ll fact(ll a) {
	int ans = 1;
	for (int i = 1; i <= a; i++) {
		ans *= i;
	}
	return ans;
}

//コンビネーション
ll combi(ll a, ll b) {
	return fact(a) / (fact(b) * fact(a - b));
}

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

	if (s.size() <= k) {
		cout << s << endl;
	}
	else {
		rep(i, k) {
			cout << s[i];
		}
		cout << "..." << endl;
	}
	return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
using ll = long long;
using ull = unsigned long long;
using vll = vector<long long>;
using pll = pair<ll, ll>;
#define FOR(i, begin, end) \
  for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) \
  for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define VREP(s, ite) for (auto ite = s.begin(); ite != s.end(); ++ite)
#define FI first
#define SE second
#define ALL(v) v.begin(), v.end()
//#define endl "\n"
#define ciosup \
  cin.tie(0);  \
  ios::sync_with_stdio(false);
#define eb emplace_back
#define vint vector<int>
constexpr ll INF = 1e15 + 7LL;
constexpr ll MOD = 1e9 + 7LL;

template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (int i = 0; i < v.size(); ++i) {
    is >> v[i];
  }
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (int i = 0; i < v.size() - 1; ++i) {
    os << v[i] << " ";
  }
  if (v.size() > 0) {
    os << v[v.size() - 1] << endl;
  }
  return os;
}

bool judge(vll& a, vll f, ll target, ll k){
  int sz = f.size();
  vll maxnumvec(sz);
  REP(i,sz){
    maxnumvec[i] = target / f[i];
  }
  sort(maxnumvec.begin(), maxnumvec.end());
  REP(i, sz) {
    if (maxnumvec[i] < a[i]){
      k -= a[i] - maxnumvec[i];
    }
    if (k < 0) return false;
  }
  return true;
}

int main() {
  ll n,k;
  cin >> n >> k;
  vll a(n), f(n);
  cin >> a >> f;
  sort(a.begin(), a.end());
  ll lo = -1, hi = 1e14;
  while (hi - lo > 1){
    ll mid = (lo + hi) / 2;
    if (judge(a, f, mid, k)){
      hi = mid;
    } else {
      lo = mid;
    }
  }
  cout << hi << endl;
}

Measured memory_bytes: 6552
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;
using static System.Console;


namespace atcorder2
{
    class Program
    {
        public static long Read()
        {

            return long.Parse(Console.ReadLine());
        }

        public static long[] Reads()
        {

            return Console.ReadLine().Split().Select(long.Parse).ToArray();
        }

       
         public static long GCM(long x,long y)
        {
            if (x < y)  GCM(y, x);


            while (y > 0)
            {
                var z = y;
                y = x % y;
                x = z;
            }
            
            return x;
        }

        



        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);


            var nab = Reads();
            var n = nab[0];
            var a = nab[1];
            var b = nab[2];
            if (a > b) WriteLine(0);
            else if (a != b && n == 1) WriteLine(0);
            else
                WriteLine(b * (n - 1) + a - (b + a * (n - 1)) + 1);












            Console.Out.Flush();
        }
    }
}




Measured memory_bytes: 18980
/**
 *    author:  tourist
 *    created: 11.05.2020 14:07:42       
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string a, b;
  int c, d;
  string e;
  cin >> a >> b >> c >> d >> e;
  if (a == e) --c; else --d;
  cout << c << " " << d << '\n';
  return 0;
}


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

#include <iostream>

#include <iostream>

class BGoldenApple
{
public:
    void solve(std::istream& in, std::ostream& out)
    {
        int N, D;
        in >> N >> D;
        int L = 2 * D + 1;
        out << (N + L - 1) / L << '\n';
    }
};


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


Measured memory_bytes: 256
//#define _USE_MATH_DEFINES
//#include <cmath>
#include <iostream>
//#include <stdio.h>
//#include <stdlib.h>
//#include <iomanip>
//#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>
//#include <time.h>
//#include <sstream>
//#include <queue>

using namespace std;


int main(){

	long long ans;
	int n;

	cin >> n;

	ans = 1;
	for (int i = 1; i <= n; i++){
		ans *= i;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1156
package main

import (
	"fmt"
	"sort"
)

func main() {
	var p, q, r int
	fmt.Scanf("%d %d %d\n", &p, &q, &r)

	a := []int{p, q, r}
	sort.Ints(a)
	ans := 0
	for i := 0; i < len(a)-1; i++ {
		ans += a[i]
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;

struct Dice {
	int tp;
	int bo;
	int no;
	int so;
	int ea;
	int we;
	Dice(vector<int>pips_) {
		tp = pips_[0];
		bo = pips_[1];
		no = pips_[2];
		so = pips_[3];
		ea = pips_[4];
		we = pips_[5];
	}
	Dice() {
		tp = 1;
		bo = 4;
		no = 2;
		so = 5;
		ea = 3;
		we = 6;
	}
	enum R_Way {
		R_Left,
		R_Front,
		R_Right,
		R_Back,

		R_Dummy,
	};
	int rotate(const R_Way way) {
		switch (way) {
		case R_Left: {
			int c = tp;
			tp = ea;
			ea = bo;
			bo = we;
			we = c;
		}
					 break;
		case R_Front: {
			int c = tp;
			tp = no;
			no = bo;
			bo = so;
			so = c;
		}
					  break;
		case R_Right: {
			int c = tp;
			tp = we;
			we = bo;
			bo = ea;
			ea = c;
		}
					  break;
		case R_Back: {
			int c = tp;
			tp = so;
			so = bo;
			bo = no;
			no = c;
		}
		
					  break;
		default:
			assert(false);
		}
		return tp;
	}
	int getpip(const int way) {
		if (static_cast<R_Way>(way) == 0)return we;
		else if (static_cast<R_Way>(way) == 1)return so;
		else if (static_cast<R_Way>(way) == 2)return ea;
		else if (static_cast<R_Way>(way) == 3)return no;
	}
	int rotate(const int way) {
		return rotate(static_cast<R_Way>(way));
	}
	int hash()const {
		return tp + we * 6 + no * 36;
	}
};

int geteast(int top, int south) {
	map<pair<int, int>, int>mp;
	mp[make_pair(1, 2)] = 3;
	mp[make_pair(1, 3)] = 5;
	mp[make_pair(2, 3)] = 1;
	bool rev = false;
	if (top >= 4) {
		rev = !rev; top = 7 - top;
	}
	if (south >= 4) {
		rev = !rev; south = 7 - south;
	}
	if (top > south) {
		rev = !rev; swap(top, south);
	}
	return rev?7-mp[make_pair(top,south)]:mp[make_pair(top, south)];
}

const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,1,0,-1 };
void fall(vector<vector<pair<int, int>>>&field, Dice d) {
	int nx = field.size()/2, ny = field.size() / 2;
	int moveway =-1;
	int num = 3;
	while (1) {
		for (int way = 0; way < 4; ++way) {
			if (field[ny][nx].first>field[ny + dy[way]][nx + dx[way]].first) {
				if (num < d.getpip(way)) {
					num = d.getpip(way);
					moveway = way;
				}
			}
		}
		if (moveway!=-1) {
			d.rotate(moveway);
			ny += dy[moveway];
			nx += dx[moveway];
		}
		else {
			field[ny][nx] = make_pair(field[ny][nx].first + 1, d.tp);
			break;
		}
		num = 3; moveway = -1;
	}
	return;
}

int main() {
	while (1) {
		int N; cin >> N;
		if (!N)break;
		vector<vector<pair<int, int>>>field(2*N+3, vector<pair<int, int>>(2 * N + 3));
		
		for (int i = 0; i < N; ++i) {
			int t, s; cin >> t >> s;
			int e = geteast(t, s);
			Dice d(vector<int>{t, 7 - t, 7 - s, s, e, 7 - e});
			fall(field, d);
		
		}
		vector<int>nums(6);
		for (int i = 0; i < 2 * N + 3; ++i) {
			for (int j = 0; j < 2 * N + 3; ++j) {
				if (field[i][j].first) {
					nums[field[i][j].second - 1]++;
				}
			}
		}
		for (int i = 0; i < 6; ++i) {
			cout << nums[i];
			if (i != 5)cout << " ";
		}
		cout << endl;
	}
	return 0;
}

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

int main() {
  char X,Y;
  cin >> X >> Y;
  if(X < Y){
    cout << "<" << endl;
  }
  else if(X == Y){
    cout << "=" << endl;
  }
  else{
    cout << ">" << endl;
  }
 }

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>

int main(){
    int x;
    std::cin>>x;

    int n = (int)sqrt(x);
    int ans = 1;
    for(int b = 1;b <= n;b++){
        int k = 1;
        for(int p = 2;p <= n;p++){
            int c = pow(b, p);
            if(c > x){
                if(p == 2){
                    break;
                }else{
                    k = c / b;
                    break;
                }
            }
        }
        if(ans < k){
            ans = k;
        }
    }
    std::cout<<ans<<std::endl;
    return 0;
}

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

#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false

int main()
{
    int a[3] = {0};
    int b = 0, c = 0;
    while (scanf("%d,%d,%d", &a[0], &a[1], &a[2]) != EOF)
    {
        //cout<<a[0]<<endl;
        if (a[2] * a[2] == a[0] * a[0] + a[1] * a[1])
            b++;
        else if (a[0] == a[1])
            c++;
    }
    cout << b << endl
         << c << endl;
    return 0;
}

Measured memory_bytes: 3112
class Item:
    def __init__(self, value, weight):
        self.value = value
        self.weight = weight


def conpute(N, W, items):
    c = [[None] * (W + 1) for i in range(N + 1)]
    c[0] = [0] * (W + 1)
    for i in range(1, N + 1):
        c[i][0] = 0
    
    for i in range(1, N + 1):
        for w in range(1, W + 1):
            c[i][w] = c[i - 1][w]
            if items[i].weight > w:
                continue
            if items[i].value + c[i - 1][w - items[i].weight] > c[i - 1][w]:
                c[i][w] = items[i].value + c[i - 1][w - items[i].weight]

    maxValue = c[N][W]

    return maxValue

if __name__ == '__main__':
    N, W = [int(v) for v in input().split()]
    items = [Item(0, 1 << 30)]
    for i in range(N):
        v, w = [int(v) for v in input().split()]
        items.append(Item(v, w))
    print(conpute(N, W, items))


Measured memory_bytes: 25576
A, B, N = map(int, input().split())

l = 0
r = N
ans = 0


def calc(x):
    return ((A * x) // B) - (A * (x // B))


for i in range(10000):

    if r - l < 10:
        for x in range(max(0, l - 10), min(N + 1, r + 10)):

            # print(f"{x} {((A * x) // B) - (A * (x // B))}")
            ans = max(ans, ((A * x) // B) - (A * (x // B)))
        break

    mid = (l + r) // 2
    mid2 = (l + mid) // 2
    if calc(l) <= calc(mid2) and calc(mid2) <= calc(mid):
        l = mid
    elif calc(l) >= calc(mid2) and calc(mid2) <= calc(mid):
        r = mid
    else:
        if calc(mid2) >= calc(mid):
            r = mid

print(ans)

# for x in range(0, N + 1):
#     ans = max(ans, ((A * x) // B) - (A * (x // B)))

# print(ans)

Measured memory_bytes: 9244
#include<stdio.h>
int main()
{
	int n,a,b,c,d,i,j,flg,x[1000],y[1000],z[1000]={0};
	flg=0;
	scanf("%d %d",&a,&b);
	scanf("%d",&n);
	for(i=0;i<n;i++){
			scanf("%d %d",&x[i],&y[i]);
	}
	for(i=0;i<n;i++){
		c=x[i];
		for(j=0;j<y[i]-x[i];j++){
			z[c]=1;
			c++;
		}
	}
	d=b-a;
	for(i=0;i<d;i++){
		if(z[a]==0){
			z[a]=1;
		}
		else flg=1;
		a++;
	}
	if(flg==1){
		printf("1\n");
	}
	else printf("0\n");
	return 0;
}


Measured memory_bytes: 2704
import itertools

a, b, c = map(int, input().split())
k = int(input())

l = [0, 1, 2, 3]


ans = False
if a < b < c:
    ans = True
else:
    for v in itertools.combinations_with_replacement(l, k):
        ll = [0, a, b, c]
        for vv in v:
            if vv == 0:
                continue
            ll[vv] = ll[vv] * 2
            if ll[1] < ll[2] < ll[3]:
                ans = True

        # print(ll)


if ans:
    print("Yes")
else:
    print("No")

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

const ll mod=1000000007;

int n; 
string mp[2];
ll dp[55];
int main(){
    cin>>n>>mp[0]>>mp[1];
    int i=0;
    if(mp[0][i]==mp[1][i]){
        dp[0]=3;
        i=1;
    }
    else{
        dp[1]=6;
        i=2;
    }
    for(;i<n;){
        if(mp[0][i]==mp[1][i]){
            if(mp[0][i-1]==mp[1][i-1]){
                dp[i]=(dp[i-1]*2)%mod;
            }
            else{
                dp[i]=dp[i-1];
            }
            ++i;
        }
        else{
            if(mp[0][i-1]==mp[1][i-1]){
                dp[i+1]=(dp[i-1]*2)%mod;
            }
            else{
                dp[i+1]=(dp[i-1]*3)%mod;
            }
            i+=2;
        }
    }
    cout<<dp[n-1]<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pi 3.141592653589793238
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define MOD 1000000007
#define INF 999999999999999999 
#define pb push_back
#define ff first
#define ss second
 
#define mt make_tuple
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
 
 
typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    fast;
    ll T = 1, i, j;
    
    //cin >> T;
    while (T--) {
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        cout << max({a * c, a * d, b * c, b * d});
    }
    return 0;
}

Measured memory_bytes: 3620
#include<iostream>
#include<stdio.h>
#include<string>
#include<cmath>
#include<math.h>
#include<vector>
#include<algorithm>
#include<map>
#pragma warning(disable: 4996)
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;


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

	rep(i, s.size()) {
		if (s[i] + N > 90) {
			
			s[i] = s[i] + N - 26;
		}
		else {
			s[i] += N;
		}
	}

	cout << s;

	return 0;
}

Measured memory_bytes: 256
#import heapq
#左取り出し→右取り出し→詰める
N,K=map(int,input().split())
V=[int(i) for i in input().split()]
ans=0
for X in range(K+1):
    for Y in range(K+1-X):
        q=[]
        Z=K-X-Y
        if X+Y>N:
            continue
        tmp=0
        for i in range(X):
            tmp+=V[i]
            if V[i]<0:
                q.append(V[i])
        for i in range(N-Y,N):
            tmp+=V[i]
            if V[i]<0:
                q.append(V[i])
        q.sort()
        if len(q)<=Z:
            tmp-=sum(q)
        else:
            tmp-=sum(q[:Z])
        ans=max(tmp,ans)
print(ans)

        

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

int h, w;
long long dp[1000][1000];
char a[1000][1000];

int main(){
	scanf("%d %d", &h, &w);
	for (int i=0; i<h; i++){
		scanf("\n");
		for (int j=0; j<w; j++) scanf("%c", &a[i][j]);
	}
	dp[0][0]=1;
	for (int i=0; i<h; i++){
		for (int j=0; j<w; j++){
			if (i==0 && j==0) continue;
			if (a[i][j]=='#') dp[i][j]=0;
			else{
				if (i==0) dp[i][j]=dp[i][j-1];
				else if (j==0) dp[i][j]=dp[i-1][j];
				else dp[i][j]=dp[i][j-1]+dp[i-1][j];
				dp[i][j]%=1000000007;
			}
		}
	}
	printf("%lld\n", dp[h-1][w-1]);
}

Measured memory_bytes: 9088
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main {

	int INF = 1 << 28;
	int[] now, next;
	int[] dp1, dp2;
	void run() {
		Scanner sc = new Scanner(System.in);
		String[] str = sc.next().split(",");
		now = new int[str.length+4];
		now[2] = Integer.parseInt(str[0]);
		dp1 = new int[51];
		dp2 = new int[51];
		dp1[1] = now[2]; 
		for(;sc.hasNext();) {
	//		debug(dp1);
			str = sc.next().split(",");
			dp2 = dp1.clone();
	//		if(str[0].equals("0")) break;
			next = new int[str.length+4];
			for(int i=0;i<str.length;i++) next[i+2] = Integer.parseInt(str[i]);
	//		debug(next);
			for(int i=2;i<=str.length+1;i++) {
				if(now.length < next.length) dp1[i-1] = max( dp2[i-2] + next[i], dp2[i-1] + next[i]);
				else dp1[i-1] = max( dp2[i-1] + next[i], dp2[i] + next[i]);
			}
			now = next.clone();
		}
		System.out.println(dp1[1]);
	}

	public static void main(String[] args) {
		new Main().run();
	}

	void debug(Object... os) {
		System.err.println(Arrays.deepToString(os));
	}
}

Measured memory_bytes: 12000
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
 
using namespace std;
 
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;
 
static const int tx[] = {0,1,0,-1};
static const int ty[] = {-1,0,1,0};
 
static const double EPS = 1e-8;

string cat_string (const string& lhs,const string& rhs){

  if(lhs.size() >= rhs.size()){
    for(int i=0;i<lhs.size();i++){
      if(lhs.size() < i+rhs.size()) break;
      string candidate = lhs.substr(i,rhs.size());
      
      if(candidate == rhs){
	return lhs;
      }
    }
  }

  for(int smoothing = min(lhs.size(),rhs.size());
      smoothing >= 0 ;
      smoothing--){
    string front = lhs.substr(lhs.size()-smoothing,smoothing);
    string rear = rhs.substr(0,smoothing);
    
    if(front == rear){
      return lhs + rhs.substr(smoothing,rhs.size()-smoothing);
    }
  }
  return lhs+rhs;
}

string compute_short_string(const string& lhs,const string& rhs){
  if(lhs.size() < rhs.size()) {
    return lhs;
  }
  else if(lhs.size() > rhs.size()) {
    return rhs;
  }
  else if(lhs.size() == rhs.size()) {
    return lhs < rhs ? lhs : rhs;
  }
}

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

    vector<int> order;
    for(int i=0;i<n;i++){
      order.push_back(i);
    }

    vector<string> constituents;
    for(int i=0;i<n;i++){
      string str;
      cin >> str;
      constituents.push_back(str);
    }

    string dp[n][1<<n];

    for(int S=0;S<=(1<<n)-1;S++){
      for(int i=0;i<n;i++){
	for(int j=0;j<=110;j++) dp[i][S].push_back('z');
      }
    }

    for(int i=0;i<n;i++) {
      dp[i][(1<<i)] = constituents[i];
    }

    for(int S=0;S<=(1<<n)-1;S++){
      for(int from=0;from < n; from++){
	if((S & (1<<from)) == 0) continue;	     
	for(int to=0;to < n; to++){
	  if(from == to) continue;
	  if(S & (1<<to)) continue;
	  dp[to][S | (1<<to)]
	    = compute_short_string(cat_string(dp[from][S],constituents[to]),dp[to][S | (1<<to)]);
	}
      }
    }

    string res = dp[0][(1<<n)-1];

    for(int i=0;i<n;i++){
      res = compute_short_string(res,dp[i][(1<<n) - 1]);
    }
    cout << res << endl;
  }
}

Measured memory_bytes: 3260
#include<stdio.h>  

int main(void){  

int n,i,ai,max,min;  

double sum;  

sum=0.0;  

max=-1000000;  

min=1000000;  

scanf("%d",&n);  

for(i=0;i<n;i++){  

scanf("%d",&ai);  

if(ai<min){  

min=ai;  

}  

if(max<ai){  

max=ai;  

}  

sum=sum+ai;  

}  

printf("%d %d %.0lf\n",min,max,sum);  

return 0;  

}

Measured memory_bytes: 632
import Control.Applicative ((<$>), (<*>))
import Control.Monad (replicateM)
import Data.Char (isDigit, digitToInt, intToDigit)

main :: IO ()
main = do
  n <- readLn
  ss <- replicateM n $ do
    o <- getLine
    m <- getLine
    return [o, m]
  mapM_ (putStrLn . solve) ss

solve :: [String] -> String
solve [o, m] = foldr f m o
  where f 'J' s = (last s) : (init s)
        f 'C' s = (tail s) ++ [head s]
        f 'E' s = let (as, bs) = splitAt (length s `div` 2) s
                  in if even (length s) then bs ++ as
                     else (tail bs) ++ (head bs : as)
        f 'A' s = reverse s
        f 'P' s = map (\c -> if isDigit c then (intToDigit . (flip mod 10) . (subtract 1) . digitToInt) c else c) s
        f 'M' s = map (\c -> if isDigit c then (intToDigit . (flip mod 10) . (+1) . digitToInt) c else c) s



Measured memory_bytes: 3764
#include<stdio.h>
int main(){
	int a,b,c,temp;
		scanf("%d %d %d",&a,&b,&c);		

	if(a>b){
temp=a,a=b,b=temp;
}
  if(b>c){
temp=b,b=c,c=temp;
}
  if(a>c){
temp=a,a=c,c=temp;
}
	if(a>b){
temp=a,a=b,b=temp;
}
printf("%d %d %d\n",a,b,c);

return 0;
}

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

int main(){
    int n;
    cin >> n;
    int arr[n] = {};
    double sum = 0;
    for(int i=0;i<n;i++){
    	cin >> arr[i];
    	sum+=arr[i]; 
    }
    //cout << sum << endl;
    int lim = round(sum/n);
    //cout << lim << endl;
    int ans= 0;
    for(int i=0;i<n;i++){
    	ans+=((abs(arr[i]-lim))*(abs(arr[i]-lim)));
    }
    cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = (ll)1e5;  
using  p = pair<int,int>;

int main(){
 int n;
 cin >> n;
 auto a = vector<int>(n,0);
 for (int i = 0; i < n; i++)
 {
   cin >> a[i];
 }

 cout << *max_element(a.begin(),a.end()) - *min_element(a.begin(),a.end());
 
}
  
  

Measured memory_bytes: 256
# coding: utf-8
# Your code here!

n,k,q=map(int,input().split())
l=[]
for i in range(n):
    l.append(0)
for i in range(q):
    a=int(input())
    l[a-1]+=1

for i in range(n):
    if k-q+l[i]<=0:
        print("No")
    else:
        print("Yes")
    


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

static const int MAX = 100000;
static const int INF = __INT_MAX__;
class Edge{
    public:
    int t,w;
    Edge(int t,int w):t(t),w(w){}
};

vector<Edge>G[MAX];
int cnt,N,d[MAX];
bool V[MAX] = {false};

void bfs(int s){
    std::fill_n(d,N,INF);
    queue<int> q;
    q.push(s);
    d[s] = 0;

    while(!q.empty()){
        int u = q.front();
        q.pop();

        for(int i = 0;i < G[u].size();++i){
            Edge e = G[u][i];
            
            if(d[e.t] == INF){
                d[e.t] = d[u] + e.w;
                q.push(e.t);
            }
        }
    }
}

void solve(){
    bfs(0);
    int maxV = 0;
    int tgt = 0;
    
    for(int i = 0;i < N;++i){
        if(d[i] == INF)continue;
        if(maxV < d[i]){
            maxV = d[i];
            tgt = i;
        }
    }
    
    bfs(tgt);
    maxV = 0;
    for(int i = 0;i < N;++i){
        if(d[i] == INF)continue;
        maxV = max(maxV,d[i]);
    }
    cout << maxV << endl;
}

int main(){
    int s,t,w;
    cin >> N;
    
    for(int i = 0;i < N - 1;++i){
        cin >> s >> t >> w;
        G[s].push_back(Edge(t,w));
        G[t].push_back(Edge(s,w));
    }
    solve();
}



Measured memory_bytes: 9824
#include <iostream>
using namespace std;
long long f(long long n,long long a,long long b){
    if(n==1) return b;
    return f(n-1,b,a+b);
    
}
int main(void){
    int n,a=2,b=1;
    cin >> n;
    cout << f(n,a,b) << endl;
    
}
   


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jaynil
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String x = in.next();
            int c = 0;
            int m = 0;
            for (int i = 0; i < x.length(); i++) {
                if (x.charAt(i) == 'A' || x.charAt(i) == 'G' || x.charAt(i) == 'C' || x.charAt(i) == 'T') {
                    c++;
                    m = Math.max(m, c);
                } else {
                    c = 0;
                }
            }
            out.println(m);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}



Measured memory_bytes: 23252
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

#define MAX_SIZE 100000

typedef struct Task
{
    char name[11];
    int time;
} Task;

Task dequeue();
void enqueue(Task);
void priTask(Task);
void proc(Task);
bool isEmpty();

Task Queue[MAX_SIZE];
int head, tail;
int sum;
int n, q;

int main(void)
{
    head = tail = 0;

    Task t;

    scanf("%d %d", &n, &q);

    while (n--) {
        scanf("%s %d", t.name, &t.time);
        proc(t);
    }

    while (!isEmpty())
        proc(dequeue());

    return 0;
}

void proc(Task t)
{
    if (t.time <= q) {
        sum += t.time;
        priTask(t);
    } else {
        t.time -= q;
        sum += q;
        enqueue(t);
    }
}

void priTask(Task t)
{
    printf("%s %d\n", t.name, sum);
}

void enqueue(Task t)
{
    Queue[tail] = t;
    tail = (tail + 1) % MAX_SIZE;
}

Task dequeue()
{
    Task tmp = Queue[head];
    head = (head + 1) % MAX_SIZE;
    return tmp;
}

bool isEmpty()
{
    return head == tail;
}


Measured memory_bytes: 3276
#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
#define int long long
typedef pair<int,int>P;
typedef pair<int,P>P2;
typedef pair<string,P>PP;
#define F first
#define S second
int dy[]={-1,0,1,0};
int dx[]={0,1,0,-1};

int n,m;
int c[100];
int d[111][111];
int p[111];

signed main(){
  int n,m,ans=0;
  cin>>n>>m;
  r(i,m){
    cin>>c[i];
    r(j,c[i])cin>>d[i][j];
  }
  r(i,m)cin>>p[i];
  for(int i=0;i<(1<<n);i++){
    int s=0;
    for(int j=0;j<m;j++){
      int sum=0;
      for(int k=0;k<c[j];k++){
        if((1<<(d[j][k]-1))&i) sum++;
      }
      if(sum%2==p[j])s++;
    }
    if(s==m)ans++;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
A,Z = map(str, input().split())
a=[str(x) for x in A]
z=[str(x) for x in Z]
aa =int(a[0]+a[1]+a[2])
aaa =int(a[0]+a[1]+a[2]+a[1]+a[0])
zz =int(z[0]+z[1]+z[2])
zzz =int(z[0]+z[1]+z[2]+z[1]+z[0])
gap = (zz-aa)+1
cnt = 0
if aaa<int(A):
    cnt-=1
if zzz>int(Z):
    cnt-=1
print(gap+cnt)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
 
using namespace std;
 
using tint = long long;
using ld = long double;
 
#define forsn(i, s, n) for(int i = s; i < int(n); i++)
#define forn(i, n) forsn(i, 0, n)
 
using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
 
using pi = pair<int,int>;
#define f first
#define s second
#define mp make_pair
 
#define DBG(x) cerr << #x << " = " << x << endl;
 
const int MOD = 1e9+7;
const int MX = 5e5+5;
const int INF = 1e9;
const ld PI = acos(ld(-1)); 
 
void NACHO(string name = "out"){
    ios_base::sync_with_stdio(0); cin.tie(0);
    //freopen((name+".in").c_str(), "r", stdin);
    //freopen((name+".out").c_str(), "w", stdout);
}
 
int main(){
	NACHO();
	int n;
	cin >> n;
	int a[n];
	forn(i, n) cin >> a[i];
	int maxi = -INF, mini = INF;
	forn(i, n){
		maxi = max(maxi, a[i]);
		mini = min(mini, a[i]);
	}
	cout << maxi-mini << endl;
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
#include <iterator>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <math.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vector<int> > 
#define vl vector<long long>
#define vc vector<char> 
#define vvc vector<vector<char> > 
#define vpi vector<pair<int,int> >
#define ll long long 
#define sz(a) int(a.size())
#define forn(i,n) for(int i = 0 ; i < int(n) ; i++)
#define all(x) x.begin(),x.end()
#define vpl vector<pair<long long,long long> > 
#define F first
#define S second
#define mp make_pair
#define ld long double
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pci pair<char,int>
#define len(s) s.length()
#define un unsigned
# define M_PI           3.14159265358979323846  /* pi */
#define modulo 998244353ll
#define mod 1000000007ll
#define MAXN  1000001 
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}
ll gcd(ll a,ll b){if(a==0 || b == 0) return max(a,b);if(a == 1 || b == 1)return 1;return gcd(max(a,b)%min(a,b),min(a,b));}


void solve()
{
    int n;
    cin>>n;
    vl sol(n,0);
    vl dif(n,0);
    forn(i,n)
    {
        ll x,y;
        cin>>x>>y;
        sol[i] = x+y;
        dif[i] = x-y;
    }
    sort(all(sol));
    sort(all(dif));
    ll ans1 = dif.back() - dif.front();
    ll ans = sol.back()-sol.front();
    ans = max(ans,ans1);
    cout<<ans<<endl;
}


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

Measured memory_bytes: 6360
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		
		int n = b - a + 1;
		int count = 0;
		
		for(int i = 0; i < n; i++) {
			if(c % (a + i) == 0) {
				count++;
			}
		}
		
		System.out.println(count);
		
	}

}



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

bool even(vector<int> a)
{
  bool b = false;
  for(auto itr = a.begin(); itr != a.end(); itr++)
  {
   // cout << "even" << endl;
    b = (*itr % 2 == 0);
    if (!b)
    {
      break;
    }
  }
  return b;
}

void mo(vector<int> &a)
{
  for(auto itr = a.begin(); itr != a.end(); itr++)
  {
    *itr = *itr / 2;
  }
  return;
}

int main() {

  int n,b;
  vector<int> a;

  cin >> n;

  for(int i = 0;i<n;i++)
  {
    cin >> b;
    a.emplace_back(b);
  }

  int j = 0;
  while(1)
  {
    if(even(a))
    {
      j++;
      for(auto itr = a.begin(); itr != a.end(); itr++)
      {
        *itr = *itr / 2;
      }
    }
    else
    {
      break;
    }
  }

  cout << j;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int in(){int x; scanf("%d",&x); return x;}
static const int MAX = 100;


int main() {
  long long d = -1, A[MAX];
  int N = in();

  rep(i, N) A[i] = in();

  rep(i, N){
    rep2(j, i+1, N){
      d = max(d, abs(A[i] - A[j]));
    }
  }

  cout << d << endl;
}

Measured memory_bytes: 636
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int arr[100005];
int dp[100005];
int ans  = 1e9 ;
int n;
int main()
{

    ////Top Down Approach :
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin>>n;
    for(int i=0;i<n+10;i++)
        dp[i]=1e9;
    for(int i=0;i<n;i++)
        cin>>arr[i];
    dp[0]=0;

    for(int i = 0;  i<n-1;i++)
    {
        dp[i+1]=min(dp[i+1],dp[i]+abs(arr[i]-arr[i+1]));
        dp[i+2]=min(dp[i+2],dp[i]+abs(arr[i]-arr[i+2]));
    }
    cout<<dp[n-1]<<endl;


}


Measured memory_bytes: 4260