akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int a , b;
int main(){
	cin >> a >> b;
	if(a > 0 && b > 0){
		cout << "Positive" << endl;
	}
	else if(a < 0 && b > 0){
		cout << "Zero" << endl;
	}
	else if(a == 0 || b == 0){
		cout << "Zero" << endl;
	}
	else{
		if((a - b + 1) % 2 == 0){
			cout << "Positive" << endl;
		}
		else {
			cout << "Negative" << endl;
		}
	}
}

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

int main()
{
	char Sentence[201];
	fgets(Sentence, 201, stdin);
	for(int i = 0; i < 201; i++){
		if('a' <= Sentence[i] && Sentence[i] <= 'z'){
			Sentence[i] += 'A' - 'a';
		}
	}
	printf("%s", Sentence);
	return 0;
}

Measured memory_bytes: 3132
N = gets.to_i
line = gets
data = line.split(" ")
data.map!{|i| i.to_i}
data.sort!{|a, b| b <=> a}
two = -1
area = 0
(N-1).times do |i|
  #p "two=#{two} data[i]=#{data[i]} data[i+1]=#{data[i+1]}"
  if two != -1
    if !data[i].equal?(two) and data[i].equal?(data[i+1])
      area = two * data[i]
      break
    end
  elsif i <= (N-4)
    if data[i].equal?(data[i+3])
      area = data[i] * data[i]
      break
    elsif data[i].equal?(data[i+1])
      two = data[i]
    end
  end
end
p area

Measured memory_bytes: 8712
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define REP(i,n) for(long long i = 0;i < n;++i)    
#define seg_size 524288
double dot(complex<double> a, complex<double> b) {
	return a.real() * b.real() + a.imag() * b.imag();
}
double gyaku_dot(complex<double> a, complex<double> b) {
	return a.real() * b.imag() - a.imag() * b.real();
}
double leng(complex<double> a) {
	return sqrt(a.real() * a.real() + a.imag() * a.imag());
}
double angles(complex<double> a, complex<double> b) {
	double cosine = dot(a, b) / (leng(a) * leng(b));
	double sine = gyaku_dot(a, b) / (leng(a) * leng(b));
	double kaku = acos(cosine);
	if (sine <= 0) {
		kaku = 2 * Ma_PI - kaku;
	}
	return kaku;
}
vector<int> convex_hull(vector<complex<double>> a) {
	vector<int> ans;
	double now_minnest = a[0].real();
	int now_itr = 0;
	REP(i, a.size()) {
		if (now_minnest > a[i].real()) {
			now_minnest = a[i].real();
			now_itr = i;
		}
	}
	ans.push_back(now_itr);
	complex<double> ba(0, 1);
	while (true) {
		int now_go = 0;
		double now_min = 0;
		int starter = ans[ans.size() - 1];
		for (int i = 0; i < a.size(); ++i) {
			if (i != starter) {
				double goa = angles(ba, a[i] - a[starter]);
				if (goa > now_min) {
					now_min = goa;
					now_go = i;
				}
			}
		}
		if (now_go == ans[0]) break;
		ans.push_back(now_go);
		ba = complex<double>(a[now_go] - a[starter]);
	}
	return ans;
}
long long gcd(long long a, long long b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int main() {
	long long n, m, x;
	cin >> n >> m >> x;
	vector<long long> input;
	REP(i, m) {
		long long a;
		cin >> a;
		input.push_back(a);
	}
	long long geko = 0;
	for (int i = 0; i < m; ++i) {
		if (input[i] < x) {
			geko++;
		}
	}
	cout << min(geko, m - geko) << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    while(1){
        int n;
        vector<int> taro;
        vector<int> hanako;
        cin >> n;
        int tanum = n;
        int hanum = n;
        if(n == 0){
            break;
        }
        vector<int>num;
        for(int i = 0;i < n*2;i++){
            num.push_back(i+1);
        }
        for(int i = 0;i < n;i++){
            int o;
            cin >> o;
            taro.push_back(o);
            num[o-1] = 0;
        }
        sort(taro.begin(),taro.end(),greater<int>());
        for(int i = n*2-1;i >= 0;i--){
            if(num[i] != 0){
                hanako.push_back(i+1);
            }
        }
        int fien = 0;
        while(1){
            if(hanum == 0){
                cout << 0 << endl;
                cout << tanum << endl;
                break;
            }
            for(int i = taro.size()-1;i >= 0;i--){
                if(taro[i] > fien){
                    fien = taro[i];
                    taro[i] = -1;
                    tanum--;
                    break;
                }
                else if(i == 0){
                    fien = 0;
                }
            }
            if(tanum == 0){
                cout << hanum << endl;
                cout << 0 << endl;
                break;
            }
            for(int i = hanako.size()-1;i >= 0;i--){
                if(hanako[i] > fien){
                    fien = hanako[i];
                    hanako[i] = -1;
                    hanum--;
                    break;
                }
                else if(i == 0){
                    fien = 0;
                }
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3100
#include <iostream>
#include <utility>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
using namespace std;
#define MAXSIZE 100000
#define MAXL 100
typedef long long int lli;
lli numAppear[MAXSIZE + 1] = {};

int main(){
    lli n;
    cin >> n;

    vector<lli> a_vec;
    lli a_min = 1000000009, a_max = -1;
    for(lli i = 0; i < n; i++){
        lli a_input;
        cin >> a_input;
        a_min = min(a_min, a_input);
        a_max = max(a_max, a_input);
        a_vec.push_back(a_input);
    }

    sort(a_vec.begin(), a_vec.end());
    /*for(lli index_a_vec = 0; index_a_vec < n; index_a_vec++){
        cout << "a_vec[" << index_a_vec << "] = " << a_vec[index_a_vec] << endl;
    }*/

    vector<pair<lli, lli>> bridge;
    lli index_numAppear = 0;
    pair<lli, lli> bridge2end;
    for(lli index_a_vec = 0; index_a_vec < n; index_a_vec++){
        if(index_a_vec == 0 && n > 1){
            numAppear[index_numAppear]++;
            bridge2end.first = a_vec[index_a_vec];
        }else{
            if(index_a_vec == n - 1){
                if(n == 1) bridge2end.first = a_vec[index_a_vec];
                bridge2end.second = index_numAppear;
                bridge.push_back(bridge2end);
            }else if(a_vec[index_a_vec] > a_vec[index_a_vec - 1]){
                bridge2end.second = index_numAppear;
                bridge.push_back(bridge2end);
                index_numAppear++;
                bridge2end.first = a_vec[index_a_vec];
            }
            numAppear[index_numAppear]++;
        }
    }

    lli ans = 0;
    for(lli i = 0; i < (lli)(bridge.size()); i++){
        //cout << "bridge[" << i << "]: a_vec = " << bridge[i].first << " -> index_numAppear = " << bridge[i].second << endl;
        ans += (bridge[i].first > numAppear[bridge[i].second])? numAppear[bridge[i].second] : numAppear[bridge[i].second] - bridge[i].first;
    }

    /*for(lli index_numAppear = 0; numAppear[index_numAppear] > 0; index_numAppear++){
        cout << "numAppear[" << index_numAppear << "] = " << numAppear[index_numAppear] << endl;
    }*/
    
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3700
#include<stdio.h>
	int main(void)
{
	int a, b, c, i, count = 0;
	scanf("%d %d %d", &a, &b, &c);
	for(i = 1; i <= c; i++){
		if(c % i == 0 && a <= i && i <= b){
			count++;
		}
	}
	printf("%d\n", count);
	return 0;
}

Measured memory_bytes: 596
#include<bits/stdc++.h>
#define U [7<<15]={}
#define G )+((c=A[a]+A[P[a]]+C[a])%k?c:0)-M(
typedef long long L;using namespace std;map<L,L>T U;
L P U,E U,Z U,H U,C U,A U,O U,X U,B U,k,n,a,b,c;char s U;
L D(L a){L d;Z[a]=1;for(map<L,L>::iterator I=T[a].begin();I!=T[a].end();I++)
  d=I->first,!Z[d]?P[d]=a,E[d]=E[a]+1,C[d]=I->second,D(d),Z[a]+=Z[d],!H[a]|Z[H[a]]<Z[d]?H[a]=d:0:0;}
L M(L i){return i?B[i]+M(i^i&-i):0;}
L S(L a,L i){for(a=M(i++G i);i<2e5;i+=i&-i)B[i]+=a;}
L K(L f){a=X[f];n=X[b];return a-n?M(O[E[a]<E[n]?a=n,n=b,b=f,n:f]G O[a])+K(P[a]):abs(M(O[f])-M(O[b]));}
main(){for(cin>>n>>k;--n;T[a][b]=T[b][a]=c)cin>>a>>b>>c;
       for(D(a=b=0);n<*Z;a=H[P[++n]]-n?n:0)for(;!b|a;S(a=H[a],O[a]=++b))X[a]=n;
       for(cin>>a;cin>>s>>a>>b;*s&2?cout<<K(a)<<endl,0:A[a]+=b,S(H[a],O[a]),S(a,O[a]-1));}

Measured memory_bytes: 38108
s1=input()
s2=input()
l1=len(s1)
l2=len(s2)
n=max(l1,l2)

Dp=[[0 for i in range(n+1)] for j in range(n+1)]
for i in range(n+1):
    Dp[0][i] = i
for i in range(n+1):
    Dp[i][0] = i
for j in range(1,n+1):
    for k in range(1,n+1):
        try:
            if s1[j-1]==s2[k-1]:
                cost=0
            else:
                cost=1
            Dp[j][k] = min(Dp[j-1][k]+1, Dp[j][k-1]+1, Dp[j-1][k-1] + cost )#置換抜けてた
        except:
            pass
#for i in range(n+1):
#    print(Dp[i])
print(Dp[l1][l2])



Measured memory_bytes: 44016
import java.util.*;

public class Main {
   public static void main(String args[]) {
     Scanner sc = new Scanner(System.in);
     int n = sc.nextInt();
     int t = sc.nextInt();
     int[] cArray = new int[n];
     int[] tArray = new int[n];
     
     int minCost = 1001;
     
     for (int i = 0; i < n; i++) {
       cArray[i] = sc.nextInt();
       tArray[i] = sc.nextInt();
       if(tArray[i] <= t) {
           minCost = Math.min(cArray[i], minCost);
       }
     }
     
     if(minCost == 1001) {
         System.out.println("TLE");
     } else {
         System.out.println(minCost);
     }
   }
}

Measured memory_bytes: 22740
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,s,f) for(i=s;i<f;i++)
#define print(v) for(auto &z:v) cout<<z<<' ';cout<<'\n'
#define hi cout<<'h'<<'i'<<'\n' 
#define pb push_back
#define pii pair<int,int>
#define F first
#define S second
#define B begin()
#define E end()
#define sz(v) (int)((v).size())
#define vi vector<int>
#define vii vector<pair<int,int>>
#define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define clk1 clock_t start_time=clock()
#define clk2 cout<<(clock()-start_time)/(double)CLOCKS_PER_SEC
#define clean(arr) memset(arr,0,sizeof(arr))
#define mod 1000000007
#define mod2 998244353
#define space 100005
//<<fixed << setprecision(9)

int main()
{
    int n,i,j,t;
    boost;
    ll d,a;
    cin>>n>>d>>a;
    pii arr[n];
    rep(i,0,n)cin>>arr[i].F>>arr[i].S;
    sort(arr,arr+n);
    queue<pii> q;
    ll add=0;
    ll ans=0;
    rep(i,0,n)
    {
        while(!q.empty() && q.front().F<=arr[i].F)
        {
            add+=q.front().S;
            q.pop();
        }

        ll h=arr[i].S+add;
        if(h>0)
        {
            q.push({arr[i].F+2*d+1, ((h+a-1)/a)*a });
            add-=((h+a-1)/a)*a;
            ans+=(h+a-1)/a;
        }
    }
    cout<<ans;
    return 0;
}



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

int main()
{
    std::string s,t;
    std::cin >> s >> t;
    int len = s.length();
    if(s == t)
    {
        puts("Yes");
        return 0;
    }
    for(int i = 1; i <= len; i++)
    {
        char p = s[len - 1];
        s[len - 1] = '\0';
        std::string l = p + s;
        //std::cout << l << std::endl;
        if(l.substr(0, len) == t)
        {
            puts("Yes");
            return 0;
        }
        s = l.substr(0, len);
    }
    puts("No");
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
const ll INF = 1LL<<60;

int main(){
  int n;
  cin >> n;
  vector<ll> num(n+1,0);
  rep(i,n) {
    ll a;
    cin >> a;
    num[i+1] = num[i] + a;
  }
  ll res = INF;
  for (int i = 1; i < n; i++) {
    res = min(res,abs(num[i]*2-num[n]));
  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 1792
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

vi factors(int n) {
  vi v;
  int i = 2;
  while (i * i <= n) {
    if (n % i == 0) {
      v.pb(i);
      n /= i;
    } else {
      i++;
    }
  }
  v.pb(n);
  return v;
}

void solve() {
  int n;
  cin >> n;
  vi t(n + 1);
  loop(i, 2, n + 1) {
    vi v = factors(i);
    rep(j, v.size()) t[v[j]]++;
  }
  int s = accumulate(all(t), 1, [](int a, int x) {
    return a * (x + 1) % MOD;
  });
  cout << s << endl;
}


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

using namespace std;

int main()
{
    int n,m;
    cin>>n>>m;
    vector<int>v(n);
    int s=0,c=0;
    for(int i=0;i<n;i++){
        cin>>v[i];
        s+=v[i];
    }
    int val;
    if(s%(4*m)==0)
    val=s/(4*m);
    else
    val=s/(4*m)+1;
    for(int i=0;i<n;i++){
        if(v[i]>=val)++c;
        if(c==m){cout<<"Yes"<<endl;return 0;}
    }
    cout<<"No"<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define uniq(x) (x).erase(unique(ALL(x)),(x).end())
#define SORT(x) sort(ALL(x))
#define REV(x) reverse(ALL(x))
#define foreach(it,x) for(__typeof((x).begin()) it=(x).begin();it!=(x).end();it++)
#define debug(x) cerr<<#x<<"="<<(x)<<endl
#define gett() cerr<<"Time:"<<clock()<<"ms."<<endl
#define ri(x) scanf("%d",&x)
#define rl(x) scanf("%lld",&x)
#define rlcfpoj(x) scanf("%I64d",&x)
#define pi(x) printf("%d",x)
#define pl(x) printf("%lld",x)
#define plcfpoj(x) printf("%I64d",x)
#define lfd() printf("\n")
#define sp() printf(" ")
#define inrep(x) int x;scanf("%d",&x);while(x--)
#define testbit(mask,i) (((mask)>>(i))&1)
#define setbit(mask,i) ((mask)|(1<<i))
#define delbit(mask,i) ((mask)^(1<<i))
string s,t;
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>s>>t;
	int res=0;
	res+=(s[0]==t[0]);
	res+=(s[1]==t[1]);
	res+=(s[2]==t[2]);
	cout<<res<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef pair<int, int> pi;
const int mod = 1e9 + 7;

string s;
int dp[555555][3];

int main(){
	int n;
	cin >> n >> s;
	s.push_back('0');
	s.push_back('0');
	int ans = 0;
	for(int i=0; i<n; i++){
		if(s[i] == '1'){
			int e = i;
			while((s[e] != '0' || s[e+1] != '0')) e++;
			string v;
			for(int j=i; j<e; j++) v.push_back(s[j]);
		//	cout << v << " = " ;
			vector<int> w;
			int cnt = 0;
			for(int j=0; j<v.size(); j++){
				if(v[j] == '0'){
					if(cnt) w.push_back(cnt);
					cnt = 0;
				}
				else cnt++;
			}
			if(cnt) w.push_back(cnt);
			if(w.size() >= 2){
				for(int i=1; i<w.size(); i++){
					dp[i][0] = max({dp[i-1][0] - 1, dp[i-1][2]}) + w[i-1];
					dp[i][1] = max({dp[i-1][1] - 1, dp[i-1][2]}) + w[i];
					if(w[i-1] > 1) dp[i][1] = max(dp[i][1], dp[i-1][0] + w[i]);
					dp[i][2] = max({dp[i-1][0], dp[i-1][1], dp[i-1][2]});
				}
				int ret = max({dp[w.size()-1][0], dp[w.size()-1][1], dp[w.size()-1][2]});
		//		cout << ret << endl;
				ans += ret;
			}
		//	else puts("none");
			i = e;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 1540
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <list>
#include <cmath>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <vector>
// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < (int64_t)n; i++)
#define REP_FOR(i, a, b) for (int64_t i = (int64_t)a; i < (int64_t)b; i++)
#define REP_REV(i, a, b) for (int64_t i = (int64_t)a; i > (int64_t)b; i--)
#define FORALL(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int64_t, int64_t> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int64_t> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int64_t infi = 1147483600;
const ll infl = 4e18 + 5;
const char EOL = '\n';
//cout << fixed << setprecision(17) << res << endl;
// const ll MOD = 1000000009;

#define M 1000000007

int main() {
    ll n;
    cin >> n;
    vector<ll> a(n);
    for (ll i = 0; i < n; ++i) {
        cin >> a[i];
    }
    ll counter = 1;
    ll breakbricks = 0;

    for (ll i = 0; i < n; ++i) {
        if (a[i] == counter) {
            counter++;
        } else {
            breakbricks++;
        }
    }

    if (breakbricks == n) {
        cout << -1 << endl;
    } else {
        cout << breakbricks << endl;
    }
}


Measured memory_bytes: 1792
#include<stdio.h>
#define N 1000001

int main(){
  int n,s[N],q,t[N],l,r,m,res=0,i;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&s[i]);
  }
  
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&t[i]);
  }
  
  for(i=0;i<q;i++){
    l=0;
    r=n;
    m=(r+l)/2;
    while(r-l>1){
      
      if(s[m]<=t[i]){
	 
	l=m;
	m=(l+r)/2;
	
      }
      
      else if(s[m]>t[i]){
	
	r=m;
	m=(l+r)/2;
	
      }
    }
    
    if(s[l]==t[i]){
      res++;
    }
    
  }
  printf("%d\n",res);
  return 0;
}



Measured memory_bytes: 2296
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		while(true){
			int n = scanner.nextInt();
			int x = scanner.nextInt();    
			
			if((n==0)&&(x==0)){
				break;
				}
			int y =0;
			int anther=0;

			for(int a=1;a<n+1;a++){	
				for(int b=2;b<n+1;b++){
					for(int c=3;c<n+1;c++){
						y =a+b+c;
						if(((((a<b) && (b<c)) && (a<c))&&(y==x))) {
							anther++;
						}
					}
				}


			}
			System.out.println(anther);
		}
			scanner.close();
		
	}
}


Measured memory_bytes: 26564
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>

using namespace std;

string s;
int N, E, W, S;

int main()
{
    cin>>s;
    for(int i = 0 ; i < s.size() ; i++ )
        if( s[i] == 'N' ) N++;
        else if( s[i] == 'E' ) E++;
        else if( s[i] == 'W' ) W++;
        else if( s[i] == 'S' ) S++;
    if( (N+S > 0 && N*S == 0) || (E+W > 0 && E*W == 0) ) puts("No");
    else puts("Yes");
    return 0;
}

Measured memory_bytes: 256
#define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
using namespace std;
int main(){
	
	int n,m;
	
	while(cin>>n>>m,n!=0||m!=0){
		vector<int> p(n);
		for(int i=0;i<n;i++)
			p[i]=i+1;
		int s=0;
		while(1){
			int z=p.size();
			if(z==1)
				break;
			int a =(s+m-1)%z;
			p.erase(p.begin()+a);
			s=a;
		}
		
		cout<<p[0]<<endl;
	}
	
	
	

}

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

int main(){
  int w, h, x, y, r;
  cin >> w >> h >> x >> y >> r;
  bool ans = false;
  if(x - r >= 0 && x + r <= w){
    if(y - r >= 0 && y + r <= h){
      ans = true;
    }
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3100
//
//  main.cpp
//  CoderTest
//
//  Created by yuya on 2019/05/20.
//  Copyright © 2019 yuya. All rights reserved.
//

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

int main(){
    int i;
    int A,B;
    cin >> A >> B;
    
    if(A >= 13) cout << B << endl;
    else if(A >= 6) cout << B/2 << endl;
    else cout << 0 << endl;
    
    return 0;
}


Measured memory_bytes: 256
# code-festival-2017-qualaC - Palindromic Matrix
from collections import Counter


def main():
    H, W, *A = open(0).read().split()
    H, W, C = int(H), int(W), Counter("".join(A)).values()
    g4 = H * W // 4
    if H % 2 and W % 2:
        g1, g2 = 1, H // 2 + W // 2
    elif H % 2 or W % 2:
        g1, g2 = 0, (W // 2 if H % 2 else H // 2)
    else:
        g1, g2 = 0, 0
    for i in C:
        x = min(i // 4, g4)
        i -= x * 4
        g4 -= x
        y = min(i // 2, g2)
        i -= y * 2
        g2 -= y
        if i % 2 and g1:
            i -= 1
            g1 -= 1
        if i:
            print("No")
            return
    print("Yes")


if __name__ == "__main__":
    main()

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N,M;
int a[3001];
int b[3001];
bool used[101];
vector<int>G[101];

bool dfs(int x,int y,int xx,int yy){
     if(x==y)return true;
     used[x]=true;
     REP(i,G[x].size()){
         if(x==xx&&G[x][i]==yy)continue;
         if(used[G[x][i]]==true)continue;
         if(dfs(G[x][i],y,xx,yy))return true;
     }
     return false;
}

int main(){
    cin>>N>>M;
    REP(i,M){
        cin>>a[i]>>b[i];
        a[i]--;b[i]--;
        G[a[i]].push_back(b[i]);
        G[b[i]].push_back(a[i]);
    }
    int ans=M;
    REP(i,M){
        REP(j,N){
            used[j]=false;
        }
        if(dfs(a[i],b[i],a[i],b[i])){
           ans--;
        }
    }
    cout<<ans<<endl;
    return(0);
}

Measured memory_bytes: 256
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
# define ALL(x)     (x).begin(),(x).end()
# define UNIQ(c)    (c).erase(unique(ALL((c))), end((c)))
# define mp         make_pair
# define eb         emplace_back
# define FOR(i,a,b) for(int i=(a);i<(b);++i)
# define REP(i,n)   FOR(i,0,n)
# define INIT       std::ios::sync_with_stdio(false);std::cin.tie(0);

int maze[1010][1010], dp[1010][1010], h, w, n;

int main() {
	while (cin >> h >> w >> n && (h || w || n)) {
		for (int i = 1; i <= h; i++)for (int j = 1; j <= w; j++) {
			cin >> maze[i][j];
		}
		for (int i = 0; i < 1010; i++)for (int j = 0; j < 1010; j++) {
			dp[i][j] = 0;
		}
		n--, dp[1][1] = n;

		for (int i = 1; i <= h; i++) for (int j = 1; j <= w; j++) {
			dp[i][j] += dp[i][j - 1] / 2;
			if (maze[i][j - 1] == 1)dp[i][j] += dp[i][j - 1] % 2;
			dp[i][j] += dp[i - 1][j] / 2;
			if (maze[i - 1][j] == 0)dp[i][j] += dp[i - 1][j] % 2;
		}

		int y = 1, x = 1, t, f;
		while (y <= h && x <= w) {
			f = maze[y][x];
			if (dp[y][x] % 2)f = !f;
			if (f == 0)y++;
			else x++;
		}

		cout << y << " " << x << endl;
	}
}

Measured memory_bytes: 10996
# https://atcoder.jp/contests/abc176/submissions/16124424
from collections import Counter
def abc176_e():
  h, w, m = map(int, input().split())
  H = []
  W = []
  for _ in range(m):
    hi, wi = map(int, input().split())
    H.append(hi)
    W.append(wi)
  mosth = Counter(H).most_common()[0]
  mostw = Counter(W).most_common()[0]
  ans1 = mosth[1]
  ans2 = mostw[1]
  wpair = []
  hpair = []
  for i, hi in enumerate(H):
    if hi == mosth[0]: continue
    wpair.append(W[i])
  for i, wi in enumerate(W):
    if wi == mostw[0]: continue
    hpair.append(H[i])
  if wpair:
    ans1 += Counter(wpair).most_common()[0][1]
  if hpair:
    ans2 += Counter(hpair).most_common()[0][1]
  ans = max(ans1, ans2)
  print(ans)

if __name__ == '__main__':
    abc176_e()

Measured memory_bytes: 231840
#include <algorithm>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <string>
#include <map>
#include <vector>

using namespace std;

int main() {
  int X;
  cin >> X;

  int c = 0;
  if (400 <= X && X <= 599) {
    c = 8;
  } else if (600 <= X && X <= 799) {
    c = 7;
  } else if (800 <= X && X <= 999) {
    c = 6;
  } else if (1000 <= X && X <= 1199) {
    c = 5;
  } else if (1200 <= X && X <= 1399) {
    c = 4;
  } else if (1400 <= X && X <= 1599) {
    c = 3;
  } else if (1600 <= X && X <= 1799) {
    c = 2;
  } else if (1800 <= X && X <= 1999) {
    c = 1;
  }

  cout << c << endl;
  return 0;
}


Measured memory_bytes: 3184
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define REV(x) reverse(ALL(x))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ld = long double;
using ll = long long;
using ui = unsigned int;
using ull = unsigned long long;
using Pi_i = pair<int, int>;
using Pll_ll = pair<ll, ll>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;
using VULL = vector<ull>;

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;
const double EPS = 1E-10;

template<class T, class S>
bool chmax(T &a, const S &b){
    if(a < b){
        a = b; return true;
    }
    return false;
}
template<class T, class S>
bool chmin(T &a, const S &b){
    if(b < a){
        a = b; return true;
    }
    return false;
}

int main(){
    string S; cin >> S;
    bool okay = true;
    if(S.length() % 2) okay = false;
    REP(i, S.length()){
        if((i % 2) && S[i] != 'i') okay = false;
        if(!(i % 2) && S[i] != 'h') okay = false;
    }
    puts(okay ? "Yes" : "No");
    return 0;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> tlll;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<30;

int main(){
  int k; cin >> k;
  string s; cin >> s;
  int n=s.size();
  if(n<=k){
    cout << s << endl;
    return 0;
  }
  rep(i,k){
    cout << s[i];
  }cout << "..." << endl;
  
}

Measured memory_bytes: 3628
#include<iostream>
#include <bits/stdc++.h> 
using namespace std;
int main()
{
	long n;
	cin>>n;
	long long int a[n],pro=1;

	
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		
	}
	int c=0;
	for(int i=0;i<n;i++)
	{
		if(a[i]==0)
		{
			c++;
		}
	}
	if(c>0)
	
	{
		cout<<"0"<<endl;
		return 0;
	}

	
	
for(int i=0;i<n;i++){
if(a[i] <=1000000000000000000/pro){
// This condition is equivalent to prod*a[i]<=10ˆ18
pro*=a[i];
}else{
cout<<("-1\n")<<endl;
return 0;

}
}
cout<<pro<<endl;
	
	


}

Measured memory_bytes: 4364
n = int(input())

n_sq = int(n**(1/2))
fact = []
for i in range(1,n_sq+2):
    if n%i == 0:
        fact.append(i)
ans = n-1
for i in fact:
    if n//i + i-2<ans:
        ans = n//i +i-2
print(ans)


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


signed main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    //cout<<std::fixed<<std::setprecision(10);

    int N, K; cin >> N>>K;

    cout << (N>=2*K-1? "YES": "NO")  << endl;
}


Measured memory_bytes: 256
N, P = map(int,input().split())
A = list(map(int,input().split()))
dp = [[[0 for k in range(2)] for j in range(N+1)] for i in range(N+1)] #dp[i][j][k]は1-iまででj個選んだ時にmod2がkとなる選び方
dp[1][0][0] = 1
if(A[0] % 2 == 0):
    dp[1][1][0] = 1
else:
    dp[1][1][1] = 1
for i in range(2, N+1):
    for j in range(i+1):
        if(j == 0):
            dp[i][j][0] = 1
        else:
            if(A[i-1] % 2 == 0):
                dp[i][j][0] = dp[i-1][j-1][0] + dp[i-1][j][0]
                dp[i][j][1] = dp[i-1][j-1][1] + dp[i-1][j][1]
            else:
                dp[i][j][0] = dp[i-1][j-1][1] + dp[i-1][j][0]
                dp[i][j][1] = dp[i-1][j-1][0] + dp[i-1][j][1]
ans = 0
if(P == 0):
    for i in range(N+1):
        ans += dp[N][i][0]
else:
    for i in range(N+1):
        ans += dp[N][i][1]
print(str(ans))

Measured memory_bytes: 3316
#include <stdio.h>

int s[100000],n,ans=0;

void binarySearch(int a){
  int j=0,l=0,r=n,mid;
  while(l<r){
    mid = (l+r)/2;
    if(s[mid]==a){
      ans++;
      break;
    }
    else if(a<s[mid])r=mid;
    else l = mid + 1;
  }
}

int main(){
  int q,i,pass;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&s[i]);
  }
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&pass);
    binarySearch(pass);
  }
  printf("%d\n",ans);
  return 0;
}



Measured memory_bytes: 2172
import java.io.*;
class Main{
    public static void main(String[] args)throws IOException{
	BufferedReader br=
	    new BufferedReader(new InputStreamReader(System.in));
	String buf;
	buf=br.readLine();
	int n=Integer.parseInt(buf);
	int money=100000;
	for(int i=1;i<=n;i++){
	    money*=1.05;
	    if(money%1000>0){
		money/=1000;
		money++;
	    }else{
		money/=1000;
	    }
	    money*=1000;
	}
	System.out.println(money);
    }
}

Measured memory_bytes: 9340
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<utility>
#include<iomanip>
using namespace std;
int main()
{
	long long int a[7];
	for(int i=0;i<7;i++)cin>>a[i];
	long long int sto=0;
	sto=a[1];
	long long int sto1=sto;
	sto+=a[0]/2*2;
	sto+=a[3]/2*2;
	sto+=a[4]/2*2;
	if(a[0]%2==1&&a[3]%2==1&&a[4]%2==1)sto+=3;
	if(a[0]>0&&a[3]>0&&a[4]>0)
	{
		a[0]--;a[3]--;a[4]--;
		sto1+=3;
	}
	sto1+=a[0]/2*2;
	sto1+=a[3]/2*2;
	sto1+=a[4]/2*2;
	cout<<max(sto,sto1)<<endl;
	return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define err(args...) {}
#ifdef DEBUG
#include "_debug.cpp"
#endif
using namespace std;
using ll = long long;
using ld = long double;
template <typename T> using lim = numeric_limits<T>;
template <typename T> istream& operator>>(istream& is, vector<T>& a) { for(T& x : a) { is >> x; } return is; }
const int N = 150;
int opt[N+2][N+2][10];
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    while(cin >> n >> m and (n or m)) {
        vector<vector<int>> pos(n + 2), slip(n + 2);
        for(int i = 1; i <= n; i++) {
            int k;
            cin >> k;
            pos[i].resize(k);
            slip[i].resize(k);
            for(int j = 0; j < k; j++) {
                cin >> pos[i][j] >> slip[i][j];
            }
        }
        for(int i = 0; i <= n + 1; i++) {
            for(int j = 0; j <= m; j++) {
                for(int cur_pos = 0; cur_pos < pos[i].size() + (i == 0 or i == n + 1); cur_pos++) {
                    if(i == 0) {
                        opt[i][j][cur_pos] = 0;    
                    } else {
                        opt[i][j][cur_pos] = lim<int>::max();
                        for(int new_pos = 0; new_pos < pos[i - 1].size() + (i - 1 == 0); new_pos++) {
                            int cost = i == n + 1 or i - 1 == 0 ? 0 : (slip[i][cur_pos] + slip[i - 1][new_pos]) * abs(pos[i][cur_pos] - pos[i - 1][new_pos]);
                            opt[i][j][cur_pos] = min(opt[i][j][cur_pos], opt[i - 1][j][new_pos] + cost);
                        }
                        if(j > 0 and i - 2 >= 0) {
                            for(int new_pos = 0; new_pos < pos[i - 2].size() + (i - 2 == 0); new_pos++) {
                                int cost = i == n + 1 or i - 2 == 0 ? 0 : (slip[i][cur_pos] + slip[i - 2][new_pos]) * abs(pos[i][cur_pos] - pos[i - 2][new_pos]);
                                opt[i][j][cur_pos] = min(opt[i][j][cur_pos], opt[i - 2][j - 1][new_pos] + cost);
                            }
                        }
                    }
                }
            }
        }
        cout << opt[n + 1][m][0] << endl;
    }
    return 0;
}



Measured memory_bytes: 3936
N, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
num = a[0]
i = 0
if sum(a) > x:
    while num <= x:
        i += 1
        num += a[i]
    print(i)
elif sum(a) == x:
    print(N)
else:
    print(N-1)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define INF 1<<28
#define MAX 100005
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

typedef long long ll;

int n, a[100005];
int dp[MAX];

int main()
{
    FASTIO
   /* 
   double start_time = clock();
    #ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
  #endif
    */
    cin>>n;
    for(int i = 1; i <= n; i++)
        cin>>a[i];
    dp[1] = 0;
    for(int i = 2; i <= n; i++){
        dp[i] = dp[i-1] + abs (a[i] - a[i-1]);
        if(i > 2){
            dp[i] = min(dp[i], dp[i-2] + abs(a[i] - a[i-2]));
        }
    }
    cout << dp[n]<<endl;

  //   double end_time = clock();
  //printf( "Time = %lf ms\n", ( (end_time - start_time) / CLOCKS_PER_SEC)*1000);
   
    return 0;
}

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

int main(){
	vector<int> a={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
	int n;
	cin >> n;
	cout << a.at(n-1) << endl;
}


Measured memory_bytes: 256
N,M,X,Y=map(int,input().split())
x=list(int(i) for i in input().split())
y=list(int(i) for i in input().split())
if min(y)>max(x):
  if X<min(y):
    if Y>max(x):
      print("No War")
    else:
      print("War")
  else:
    print("War")
else:
  print("War")

Measured memory_bytes: 3064
using System;

class ITP1_2_D {
    public static void Main() {

        string[] Input = Console.ReadLine().Split(' ');

        int W = int.Parse(Input[0]);
        int H = int.Parse(Input[1]);
        int x = int.Parse(Input[2]);
        int y = int.Parse(Input[3]);
        int r = int.Parse(Input[4]);

        bool isSafe = true;

        if (x < r || x > W - r) isSafe = false;
        if (y < r || y > H - r) isSafe = false;

        if (isSafe) Console.WriteLine("Yes");
        else Console.WriteLine("No");
    }
}

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

int gcd(int x, int y);

const int INF = 1001001001;

/*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, const mint & a) { return is >> a.x; }
ostream& operator<<(ostream & os, const mint & a) { return os << a.x; }*/


int main() {
    int n;
    cin >> n;
    vector<string> w(n);
    rep(i, n) {
        cin >> w[i];
    }
    
    char c = w[0][w[0].size() - 1];
    for (int i = 1; i < n; i++) {
        if (c != w[i][0]) {
            cout << "No" << endl;
            return 0;
        }
        for (int j = i - 1; j >= 0; j--) {
            if (w[i] == w[j]) {
                cout << "No" << endl;
                return 0;
            }
        }
        c = w[i][w[i].size() - 1];
    }
    cout << "Yes" << endl;
    return 0;
}

/*���C�u�����ő����*/
//���[�O���b�h�̌ݏ��@
int gcd(int x, int y) {
    int num[3];
    num[0] = (x > y) ? x : y;
    num[1] = (x <= y) ? x : y;
    num[2] = num[0] % num[1];

    while (num[2]) {
        num[0] = num[1];
        num[1] = num[2];
        num[2] = num[0] % num[1];
    }

    return num[1];
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define ALL(v) (v).begin(),(v).end()
#define Vi vector<int>
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>b;i--)
#define leng(n) (int)(log10(n)+1)
#define INF 9000000000000000000
using namespace std;

int gcd(int a,int b){return b?gcd(b,a%b):a;}  //  最大公約数gcd
int lcm(int a,int b){return a/gcd(a,b)*b;}  //  最小公倍数lcm

signed main() {
  int a,b,c;
  cin >> a >> b >> c;
  rep(i,0,100){
    if((i*a)%b == c) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}


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

using namespace std;

int main(){
    int r, D, x;
    cin >> r >> D >> x;
    
    vector<int> ans(11);
    ans[0] = x;
    
    for(int i = 1; i <= 10; ++i){
        ans[i] = r * ans[i - 1] - D;
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<unordered_map>
#include<cmath>
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;


int main(){
	double L;
	cin>>L;
	int ma = 0;
	cout << fixed << setprecision(100);
	cout<<L/3*L/3*L/3<<endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(void){
    int m[11];
    for(int i=0; i<10; i++){
        cin >> m[i];
    }
    sort(m, m+10);
    for(int i=9; i>6; i--){
        cout << m[i] << "\n";
    }
    
    
    return 0;
}


Measured memory_bytes: 3152
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <climits>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
using namespace std;

#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++ )
#define repf(i,m,n) for(ll (i)=m;(i)<n;(i)++)
#define all(v) (v).begin(), (v).end()
#define ll long long
#define vec(name,num) vector<ll> name((num),0);
#define op(i) cout<<(i)<<endl;
#define opf(i) cout<<fixed<<setprecision(10)<<(i)<<endl;
#define ip(i) cin>>(i);
#define opN cout<<"No"<<endl;
#define opY cout<<"Yes"<<endl;
#define opP cout<<"Possible"<<endl;
#define opI cout<<"Impossible"<<endl;
#define mat(name,fnum,snum); vector<vector<ll>> name((fnum),vector<ll>((snum),0));
#define matC(name,fnum,snum); vector<vector<char>> name((fnum),vector<char>((snum),0));
#define debugP int debug_point; cin>>debug_point;
#define FI first
#define SE second
const ll MOD= 1e9 + 7;

//
void solve(long long N, std::vector<long long> A, std::vector<long long> B){
    ll tmp=0;
    ll sum=0;
    rep(i,N){
        if(A[i]<B[i]+tmp){
            tmp=min((B[i]+tmp-A[i]),B[i]);
            sum+=A[i];
        }else{
            sum+=tmp;
            tmp=0;
            sum+=B[i];
        }
    }
    sum+=min(tmp,A[N]);
    
    tmp=0;
    ll Sum=0;
    op(max(sum,Sum));
}

// Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N+1);
    for(int i = 0 ; i < N+1 ; i++){
        scanf("%lld",&A[i]);
    }
    std::vector<long long> B(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&B[i]);
    }
    solve(N, std::move(A), std::move(B));
    return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#define rep(i,s,n) for(int i=s;i<n;i++)
#define Z 10010
using namespace std;
int d[Z+1];
int main(){
	int n,m,k,r,l;
	while(true){
		cin>>n>>k>>m>>r;
		if(!(n+m+k+r))break;
		rep(i,0,Z)d[i]=0;
		k=1,l=n;
		rep(i,0,Z)d[i]+=k/l,k%=l,k*=10;
		if(m)rep(i,1,n){k=1,l=i*n;rep(j,0,Z)d[j]+=k/l,k%=l,k*=10;}
		for(int i=Z;i>0;i--)d[i-1]+=d[i]/10,d[i]%=10;
		cout<<d[0]<<".";
		rep(i,1,r+1)cout<<d[i];
		cout<<endl;
	}
	return 0;
}

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

int main(){
int i = 0;
string nm;
cin >> nm;
vector<char> Nickname(nm.begin(),nm.end());

for(i = 0;i < 3;i++)
{
  cout << Nickname[i];
}
  cout << endl;
return 0;
}

Measured memory_bytes: 3588
import java.util.Scanner;
public class Main{
	public static void main(String [] args){
		Scanner sc = new Scanner(System.in);
		String work = "";
		int len,sum;
		work = sc.next();
		len = work.length();
		sum = 0;
		while(true){
			if(work.charAt(0) == '0'){
				break;
			}
			for(int i = 0; i < len; i++){
				sum += Integer.parseInt(work.substring(i,i+1));
			}
			System.out.println(sum);
			work = sc.next();
			len = work.length();
			sum = 0;
		}
	}
}

Measured memory_bytes: 26516
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //ai>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //ai>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define REV(x) (reverse(x.begin(),x.end())) //reverse
#define TO(x,t,f) ((x)?(t):(f))
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define FILV(x,a) fill(x.begin(),x.end(),a)
#define FILA(ar,N,a) fill(ar,ar+N,a)
#define NEXTP(x) next_permutation(x.begin(),x.end())
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;else return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define pb push_back
#define pri(aa) cout<<(aa)<<endl
#define mp(x,y) make_pair(x,y)
#define fi first
#define se second
const ll INF=1e18+7;
const ll N = 1007;


int main(){
	ll n;
	cin>>n;
	ll ans = 0;
	FOR(i,0,n){
		ll k;
		cin>>k;
		ans+=k-1;
	}
	cout<<ans<<endl;
}

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

int main() {
	// your code goes here
	string s;
	cin>>s;
	int a[2];
	a[0]=a[1]=0;
	for(int i=0;i<s.length();i++)
	a[s[i]-'A']++;
	if(a[0]==0 || a[1]==0)
	cout<<"No";
	else
	cout<<"Yes";
	return 0;
}


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

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false), cin.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'

using namespace std;

main()
{
    fast;
    string s;
    int i,r=0,b=0;
    cin>>s;
    for (i=0;i<s.size();i++)
    {
        if (s[i]=='0')
            r++;
        else
            b++;
    }
    cout<<min(r,b)*2<<endl;
}

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

// definition {{{ 1

// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)

#define Scll(x) scanf("%llu", &x)
#define Scll2(x,y) scanf("%llu%llu", &x, &y)
#define Scll3(x,y,z) scanf("%llu%llu%llu", &x, &y, &z)

#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2

// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2

// systems {{{ 2
#define Rep(x,y) for(int x = 0; x < y; x++)
#define Repe(x,y,z) for(int x = z; x < y; x++)
// }}} 2

// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n");
// }}} 2

// }}} 1

int main() {

    int n, a;
    int card[100003] = {};

    Scd(n);
    int j = 0;
    Rep(i,n){
        Scd(a);
        card[a]++;
        if( card[a] == 3 ) card[a] = 1;
    }

    int c1 = 0, c2 = 0;

    Rep(i,100001){
        if( card[i] ) {
            c1++;
            if( card[i] == 2){
                c2++;
            }
        }
    }

    if( c2 % 2 ) c1--;

    printf ("%d\n", c1);

    return 0;
}



Measured memory_bytes: 768
// Hail god Yato
 
#include <bits/stdc++.h> 
using namespace std;
 
#define hs ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = 1e18;
const ll MAX = 100001;
//
//
void solve(){
    int a, b;
    cin>>a>>b;
    if((a&1) && (b&1))
        cout<<"Yes";
    else
        cout<<"No";
}
int main(){ 
        hs;
        ll t;
        t=1;
        // cin>>t;
        for (int i=1; i<=t; i++){
                //cout<<"Case #"<<i<<": ";
                solve();
         }
        return 0; 
}

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

class Dice{
	public:
		Dice(int in[]);
		void rotate(char d);
		int getTop();
	private:
		int *nums;
		//according to description, not use num[0]
		static int rotation[4][6];
		//N, W, S, E
		//new_nums[i] = old_nums[rotation[dir][i]]
};

Dice::Dice(int in[]){
	nums = new int[7];
	for(int i=1;i<=6;i++){
		nums[i]=in[i];
	}
}

int Dice::getTop(){
	return nums[1];
}

int Dice::rotation[4][6] = 
{{2, 6, 3, 4, 1, 5}, //N
 {3, 2, 6, 1, 5, 4}, //W
 {5, 1, 3, 4, 6, 2}, //S
 {4, 2, 1, 6, 5, 3}};//E

void Dice::rotate(char d){
	int dir;
	switch(d){
	case 'N': dir=0; break;
	case 'W': dir=1; break;
	case 'S': dir=2; break;
	case 'E': dir=3; break;
	}

	int *new_nums = new int[7];
	for (int i=1; i<=6; i++){
		new_nums[i] = nums[rotation[dir][i-1]];
	}
	delete [] nums;
	nums = new_nums;
}

int main(){
	int in[7];
	for(int i=1;i<=6;i++){
		cin >> in[i];
	}
	Dice d1(in);

	char dir;
	while( cin >> dir ){
		d1.rotate(dir);
	}
	cout << d1.getTop() << endl;
}

Measured memory_bytes: 1196