akhauriyash/Code-Regression huggingface dataset:
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {
	char a, b; cin >> a >> b;

	if (a < b) {
		cout << "<" << endl;
	}
	else if (a == b) {
		cout << "=" << endl;
	}
	else {
		cout << ">" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。
string upper(string str);       // 英字を大文字に変換する。
string lower(string str);       // 英字を小文字に変換する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>
#define GCD(a,b)      __gcd((a),(b))
#define LCM(a,b)      (a)/GCD((a),(b))*(b)
#define kiriage(a,b)  ((a)+(b)-1)/(b)

const int INF = 1e9;

// code
// ------------------------------------------------
int main() {

  int n,k;
  cin >> n >>k;
  int ans = 1;

  rep(i,n)
  {
    ans = min(ans * 2,ans + k);
  }

  cout << ans << endl;

  return 0;
}
// funcの実体
// ------------------------------------------------
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

string upper(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(97 <= *itr && *itr <= 122)
    {
      *itr = *itr - 32;
    }
  }
  return str;
}

string lower(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(65 <= *itr && *itr <= 90)
    {
      *itr = *itr + 32;
    }
  }
  return str;
}


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

int main() {
    int A, B;
    cin >> A >> B;
    int count = 0;
    int a, b, c, d;
    for(int i = A; i <= B; ++i) {
        a = i / 10000;
        b = i / 1000 % 10;
        c = i % 100 / 10;
        d = i % 10;
        if(a==d & b==c) ++count;
    }
    cout << count << endl;
}

Measured memory_bytes: 256
import java.util.*; 
 
public class Main{
  
  public static void main (String [] args){
    Scanner sc = new Scanner(System.in);     
    int A1 = sc.nextInt();
    int A2 = sc.nextInt();
    int A3 = sc.nextInt();
    
    if(A1 + A2 + A3 >= 22){
      System.out.println("bust");
    }else{
      System.out.println("win");
    } 
  }
}

Measured memory_bytes: 21588
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

using namespace std;

typedef long long ll;

int main(){
  ll q, h, s, d, n; cin >> q >> h >> s >> d >> n;
  ll t = min(min(q*8, h*4), min(s*2, d));
  if(n %2 == 1){
    ll tt = min(min(q*4, h*2), s);
    cout << t*(n/2)+tt << endl;
  }else{
    cout << t*(n/2) << endl;
  }
}

Measured memory_bytes: 768
#! /usr/bin/env python3
# -*- coding:utf-8 -*-

def generate_children(num_children, pl):
    children = ["0"]*num_children
    if num_children == 0: return []
    if num_children%2 == 0:
        children[pl-1] = str(int(num_children/2))
        children[pl] = str(int(num_children/2))
    else:
        if (num_children - pl)%2 == 0:
            children[pl-1] = str(int((num_children+1)/2))
            children[pl] = str(int((num_children-1)/2))
        else:
            children[pl-1] = str(int((num_children-1)/2))
            children[pl] = str(int((num_children+1)/2))
    return children


def gathering(s):
    children = []
    pr = 0
    pl = 0
    now = ""
    for i, x in enumerate(s):
        if x == now: continue
        if x == 'L': pl = i
        if x == 'R':
            children.extend(generate_children(i-pr, pl-pr))
            pr = i
        now = x
    children.extend(generate_children(len(s)-pr, pl-pr))
    return ' '.join(children)

def main():
    s = input()
    print(gathering(s))

if __name__ == '__main__':
    main()


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

const int maxn = 1e5 + 10;

ll n;
int arr[maxn];
int tree[maxn * 2];

int get_idx(int x) {
    return x + maxn;
}

void update(int x) {
    while(x < maxn * 2) {
        ++tree[x];
        x += x & -x;
    }
}

int query(int x) {
    int ret = 0;
    while(x) {
        ret += tree[x];
        x -= x & -x;
    }
    return ret;
}

int main(void) {
    scanf("%lld", &n);
    for(int i = 1; i <= n; ++i) scanf("%d", arr + i);
    int st = 1, ed = 1e9;
    int ans = INT_MAX;
    while(st <= ed) {
        int mid = st + ed >> 1;

        ll cnt = 0;
        memset(tree, 0, sizeof(tree));
        int base = 0;
        for(int i = 1; i <= n; ++i) {
            int now = arr[i] < mid ? -1 : 1;
            base += now;
            update(get_idx(now - base));
            cnt += query(get_idx(-base - 1));
        }

        //printf("%d %lld\n", mid, cnt);

        if(cnt <= n * (n + 1) / 4) { 
            st = mid + 1;
            ans = mid;              

        }
        else {
            ed = mid - 1;
        }
    }
    printf("%d", ans);
    return 0;
}

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

#include <string>
#include <vector>
#include <algorithm>
#include <math.h>

const double PI = 3.14;


int main()
{
	uint64_t a1;
	cin >> a1;

	vector< int > vec;

	for( int i=0 ; i<a1 ; i++ )
	{
		int tmp;
		cin >> tmp;

		if( ( tmp & 1 ) == 0 )
		{
			vec.emplace_back( tmp );
		}
	}


	bool yurusu = true;

	for( auto &it : vec )
	{
		if( it % 3 == 0 )	continue;
		if( it % 5 == 0 )	continue;

		yurusu = false;
		break;
	}

	cout << ( yurusu ? "APPROVED" : "DENIED " ) << endl;

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#define swap(type,a,b) do{type t=a;a=b;b=t;}while(0);
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ll long long
#define INF 100000000
#define FOR(i,a,n) for(i=a;i<n;i++)

void fill(int a[],int b,int c){
 	for(int i=0;i<b;i++) a[i]=c;
 	return;
}

int comp(const void *a,const void *b){
    return *(int*)a - *(int*)b;
}
int a[100000];
int main(void)
{
    int n,i,ans=1;
    int size=0;
    scanf("%d",&n);
    FOR(i,0,n){
        scanf("%d",&a[size]);
        if(size>0&&a[size]==a[size-1]) size--;
        size++;
    };
    for(i=0;i<size-2;){
        if(a[i+1]-a[i]>0&&a[i+2]-a[i+1]<0) ans++,i+=2;
        else if(a[i+1]-a[i]<0&&a[i+2]-a[i+1]>0) ans++,i+=2;
        else i++;
    }
    printf("%d\n",ans);
 	return 0;
}


Measured memory_bytes: 512
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<map>
#include<numeric>
#include<queue>
#include<string>
#include<sstream>

using namespace std;


int main(void) {

  string left = "qwertasdfgzxcvb";

  string s;
  while(cin >> s){
    if( s[0] == '#' ) break;
    vector<bool> b(s.size(), false);
    for(int i=0; i<s.size(); i++){
      for(int j=0; j<left.size(); j++){
        if( s[i] == left[j] ){
          b[i] = true;
          break;
        }
      }
    }
    int cnt = 0;
    bool f = b[0];
    for(int i=0; i<b.size(); i++){
      if( f != b[i] ){
        f = !f;
        cnt++;
      }
    }
    cout << cnt << endl;
  }

  return 0;
}










//

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

///******************************** C o n t a i n e r ********************************///

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;

///*********************************** C o n s t ***********************************///

const int       N=1e6+3;
const double    PI = acos(-1);
const ll        MOD=1000000007;                 ///1e9+7
ll dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
ll dy[] = {0, +1, 0, -1, +1, -1, +1, -1};



#define pb push_back
#define F first
#define S second
#define test int tc; cin>>tc; while(tc--)
#define forn(i,n) for(i=0;i<n;i++)
#define rforn(i,n) for(i=n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(x) x.size()
#define el <<'\n'
#define gap ' '
#define print(a) {for(auto x:a)cout<<x<<" ";cout<<endl;}
#define mem(a,b) memset(a, b, sizeof(a))
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) (a)*(a)
#define r return 0

#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

///*********************************** F u n c t i o n ***********************************///

ll powmod(ll a,ll b){ll p=MOD;a%=p;if(!a) return 0;ll pr=1;while(b>0){if(b&1){pr*=a;pr%=p;--b;}a*=a;a%=p;b/=2;}return pr;}
bool isPrime(ll n){ if(n<=1)return false;if(n<=3)return true;if(n%2==0 or n%3==0)return false;for(ll i=5;i*i<=n;i+=6){if(n%i==0 or n%(i+2)==0)return false;}return true;}
void seive(bool a[]){ll mx=sqrt(N),ii,jj;for(ii=3;ii<=mx;ii+=2)if(!a[ii])for(jj=ii*ii;jj<=N;jj+=2*ii)a[jj]=true;}
void numofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<=N;jj+=ii){if(jj==ii*ii) a[jj]++; else a[jj]+=2;}}}
void sumofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<=N;jj+=ii){if(jj==ii*ii) a[jj]+=ii; else a[jj]+=ii+jj/ii;}}}

///**************************************************** C o d e ****************************************************///
///-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=///

 int main()
 { int d,t,s;
 cin>>d>>t>>s;
 if(t*s>=d)cout<<"Yes"<<endl;
 else
 {cout<<"No"<<endl;}


 r;


}


///Thanking you by Roxy





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

using namespace std;
int main(int argc, const char * argv[]) {
    
    int n;
    int c=4, d=7;
    cin >> n;

    bool f=false;
    for (int i=0; i<=n/c; i++) {
        if ( (n - i*c) % d == 0 ) {
            f = true;
            break;
        }
    }

    cout << ( f ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 256
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <array>
#include <bitset> 
#include <unordered_map>

using namespace std;
typedef long long LL;
typedef pair<int,int> P;

const int L=1e5+1;
int n;
vector<int> es[L];
P dfs(int r,int d,int p)
{
	P ret=P(d,r);
	for(auto e:es[r]){
		if(e==p){
			continue;
		}
		ret=max(ret,dfs(e,d+1,r));
	}
	return ret;
}
vector<int> ord;
int main() {
	cin >> n;
	for(int i=0;i<n-1;i++){
		int u,v;
		cin >> u >> v;
		es[u].push_back(v);
		es[v].push_back(u);
	}
	P p=dfs(1,0,0);
	P q=dfs(p.second,0,0);
	vector<int> ret;
	vector<int> ret1;

	int s=p.second;
	int t=q.second;
	for(int k=0;k<2;k++){
		int r=s;
		int pre=0;
		while(1){
			int nx=0;
			int v=ret.size()+1;
			for(auto e:es[r]){
				if(e==pre){
					continue;
				}
				if(es[e].size()>1||e==t){
					if(nx){
						cout << -1 << endl;
						return 0;
					}
					nx=e;
				}
				else{
					ret.push_back(ret.size()+2);
				}
			}
			ret.push_back(v);
			if(nx==0){
				break;
			}
			pre=r;
			r=nx;
		}
		ret.swap(ret1);
		swap(s,t);
	}
	if(ret1<ret){
		ret.swap(ret1);
	}
	auto sp="";
	for(auto v:ret){
		cout << sp << v;
		sp=" ";
	}
	cout << endl;

	return 0;
}



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

namespace abc153_a
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> input = Console.ReadLine().Split(' ').Select(int.Parse).ToList();


            int output = input[0] / input[1];
            if (input[0] % input[1]!=0)
            {
                output++;
            }


            Console.WriteLine(output);
        }
    }
}


Measured memory_bytes: 11220
/*#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#define Fast ios_base::sync_with_stdio(false);cin.tie(NULL);
typedef pair<ll , pair<ll, ll> > pi;
int pow(int x,int y){
    int res=1;
    while(y){
        if(y&1) res*=x;
        y>>=1;
        x*=x;
    }
    return res;
}   
struct Compare {
    constexpr bool operator()(pi const & a,
                              pi const & b) const noexcept
    { return a.first < b.first || (a.first == b.first && a.second.first > b.second.first); }
 
};
void prefix_function( string s,ll arr[] )
{
     long long border=0; arr[0]=0;
    for(long long i=1;i<s.size();i++)
    {
      while(border>0 && s[i]!=s[border])
        border=arr[border-1];
     
     if(s[i]==s[border])
         border++;
      else
       border=0;
      
      arr[i]=border;
    }
}//send mod-2 for a^-1 if mod is a prime number

ll mod=1000000007;
ll add( ll a , ll b)
{
    return (((a%mod)+(b%mod))%mod);
}
ll mul(ll a,ll b)
{
  return (((a%mod)*(b%mod))%mod);
}
ll binpow(ll a, ll b) {
    ll res = 1;
    while (b) {
        if (b & 1) res = mul(res, a);
        a = mul(a, a);
        b >>= 1;
    }
    return res;
}
ll subs(ll a,ll b)
{
    return (((a%mod)-(b%mod)+mod)%mod);
}
ll dv(ll a,ll b)
{
    ll inv=binpow(b,mod-2);
    return mul(a,inv);
}

ll dsu_arr[100000];
ll dsu_sz[100000];
void dsu(ll n)
{
    for(ll i=0;i<=n;i++)
    {
        dsu_arr[i]=i;
        dsu_sz[i]=1;
    }
}
ll find(ll x)
{
     ll root=x;
    while (root!=dsu_arr[root])
    {
        root=dsu_arr[root];
    }
    while(x!=dsu_arr[x])
    {
        dsu_arr[x]=root;
        x=dsu_arr[x];
    }
    return root;
}
ll merge(ll x,ll y)
{
    ll root1=find(x);
    ll root2=find(y);
    
    if(root1==root2)
    return 0ll;
 
    if(dsu_sz[x]>dsu_sz[y]){
    dsu_arr[root2]=root1;
    dsu_sz[root1]+=dsu_sz[root2];
    }
    else
    {
         dsu_sz[root2]+=dsu_sz[root1];
        dsu_arr[root1]=root2;
    }
    return 1ll;
}
/*
vector<ll>adj[100005];
bool vis[100005];
ll dist[100005];
void bfs(ll c)
{
  vis[c]=true;
  dist[c]=0;
  q.push(c);
while(!q.empty())
{
    ll x=q.front();
    q.pop();
   
    for(ll i=0;i<adj[x].size();i++)
    {
        ll y=adj[x][i];
        if(!vis[y])
        {
            vis[y]=true;
            dist[y]=dist[x]+1;
            
            q.push(y);
        }
    }
 
}
}
*/

int main()
{
    Fast
ll n;

cin>>n;
if(n==1)
{
    cout<<0<<endl;
    return 0;
}
cout<<add(subs(binpow(10ll,n),mul(2ll,binpow(9ll,n))),binpow(8ll,n))<<endl;
//355618580
}



   
      
    
        



Measured memory_bytes: 3616
#pragma GCC optimize("Ofast")
#include <cstdio>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
using namespace std;
#define INF 1LL << 61
#define MAX 1LL << 30
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,ll> P;
//typedef pair<pair<int,int>,int> p;
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)
struct edge{ll to,cost,val;};
template<class T,class U>bool chmin(T&a,const U&b){if(a<=b)return false;a=b;return true;}
template<class T,class U>bool chmax(T&a,const U&b){if(a>=b)return false;a=b;return true;}
//__builtin_popcount(S);
//C.erase(unique(C.begin(),C.end()),C.end());
//#define int ll
int dx[]={1,-1,0,0},dy[]={0,0,-1,1};

ll dfs(ll x){
    if(x==1) return 1;
    else if(x<=0) return 0;
    return dfs(x/2)*2+1;
}

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

    ll H;
    cin>>H;
    cout<<dfs(H)<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long int ll;
const int INF=2147483647;
using namespace std;
#define SIZE 13
inline ll read(){
	ll x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}
int N,M,X,flag,ans=INF;
int POW[SIZE],a[SIZE];
int b[SIZE][SIZE],c[SIZE];
int main(){
	POW[0] = 1;
	for(int i = 1; i <=SIZE; i++) POW[i] = POW[i-1]<<1;
	N=read(),M=read(),X=read();
	for(int i = 0; i < N; i++){
		a[i]=read();
		for(int j = 0; j < M; j++) b[i][j]=read();
	}	
	for(int i = 0; i < POW[N]; i++){
		memset(c,0,sizeof(c)); 
		int sum = 0;
		for(int j = 0; j < N; j++){
			if(i & POW[j]){
				sum += a[j];
				for(int k = 0; k < M; k++)c[k] += b[j][k];
			}
		} 
		flag = 1;
		for(int j = 0; j < M; j++){
			if(c[j] < X){
				flag = 0;
				break;
			}
		}
		if(flag) ans = min(ans,sum);
	}
	if(ans == INF) printf("-1\n");
	else printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 3752
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<cstring>
#include<math.h>
#include<bitset>
#include<queue>
#include<set>
#include<iomanip>
#include<math.h>
#include<assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr int INFI = 1000000007;
const int mod = 1000000007;
int main(void){
int n;

cin>>n;

vector<int> a(200100);
int count=0;

for(int i=0;i<n;i++){
cin>>a.at(i);
if(a.at(i)==count+1){count++;}
}

if(count!=0){cout<<n-count<<endl;}else{cout<<"-1"<<endl;}
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define push push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<long long> V;
typedef vector<V> VV;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<62;
const int INF = 1<<30;
double RadianToDegree(double radian)
{
    return radian * 180.0 / acos(-1);
    
}
int main(){
    double a,b,x;
    double ans=0.0;
    cin >>a>>b>>x;
    double s=x/a;
    double t;
    if(a*b/2.0 >s){
        t=s*2/b;
        ans=atan2(b,t);
    }else{
        t=((a*b)-s)*2/a;
        ans=atan2(t,a);
    }
    printf("%.9lf\n", RadianToDegree(ans));
}

Measured memory_bytes: 512
n, a, b = gets.chomp.split(" ").map(&:to_i)

min = [a, b].min
max = [a, b].max

if min == max
  p 0
elsif (max - min) % 2 == 0
  print "#{(max - min) / 2}\n"
else
  if max - 1 > n - min
    t = (n - max + 1)
    if n - (min + t) > 0
      t_a = (n - (min + t)) / 2
      print "#{t + t_a}\n"
    else
      print "#{t}\n"
    end
  else
    t = min
    if (max - t) > 0
      t_a = (max - t) / 2
      print "#{t + t_a}\n"
    else
      print "#{t}\n"
    end
  end
end

Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
int a[12][12];
int main()
{
    int n,m,x;
    cin>>n>>m>>x;
    int c[n],a[n][m];
    for(int i=0; i<n; i++)
    {
        cin>>c[i];
        for(int j=0; j<m; j++)
        {
            cin>>a[i][j];
        }
    }
    int ans=INF;
    for(int i=0; i<(1<<n); i++)
    {
        int sum=0;
        vector<int> d(n);
        for(int j=0; j<n; j++)
        {
            if(i&(1<<j))
            {
                sum+=c[j];
                //cout<<sum<<endl;
                for(int k=0; k<m; k++)
                {
                    d[k]+=a[j][k];
                   // cout<<d[k]<<endl;
                }
            }
        }
        bool t=true;
        for(int k=0; k<m; k++)
        {
            if(d[k]<x){
                t=false;}
        }
        if(t)
        {
            ans=min(ans,sum);
        }
    }

    if(ans==INF) cout<<"-1"<<endl;
    else cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 3532
import sys
import numpy as np
readline=sys.stdin.readline
read=sys.stdin.read

n,c=map(int,readline().split())
m=2*10**5
stc=[list(map(int,l.split())) for l in read().splitlines()]
cht=np.zeros((c,m+1),dtype='int64')
for e in stc:
  cht[e[2]-1,2*e[0]-1:2*e[1]]=np.ones(2*e[1]-2*e[0]+1)
print(max(np.sum(cht,axis=0)))


Measured memory_bytes: 94440
def fac(n, p):
    ret = 1
    for i in range(2, n + 1):
        ret = ret * i % p
    return ret

N, M = [int(x) for x in input().split()]
p = 10 ** 9 + 7
if abs(N - M) >= 2:
    ans = 0
elif N == M:
    ans = 2 * fac(N, p) * fac(M, p) % p
else:
    ans = fac(N, p) * fac(M, p) % p

print(ans)

Measured memory_bytes: 8948
#include<cstdio>
#include<algorithm>
#include<functional>
#include<cstring>
#include<iostream>
#include<cmath>
#include<queue>
#include<cctype>
#include<string>
using namespace std;
#define rep(i,a,b) for(i=a;i<=b;i++)
#define INF 2100000000
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define lb lower_bound
#define ub upper_bound
#define SS stringstream
#define sz(x) ((int)(x).size())
int glid[4545][4545],leng[4545],flg[4545];
typedef pair<int,int> PPAP;
int main(void)
{
	int n,k,i,j,kk;
	int a,b,c,d,cost,go,ff;
	while(cin>>n>>k&&n&&k) {
		rep(i,1,n)rep(j,1,n)glid[i][j]=INF;
		rep(i,1,k) {
			cin>>a;
			rep(j,1,n) leng[j]=INF,flg[j]=0;
			if(a==1) {
				cin>>b>>c>>d;
				glid[b][c]=min(glid[b][c],d);
				glid[c][b]=min(glid[c][b],d);
			}
			else {
				cin>>b>>c;
				leng[b]=0,ff=0;
				priority_queue<PPAP,vector<PPAP>,greater<PPAP> > que;
				que.push(PPAP(0,b));
				while(!que.empty()) {
					cost=que.top().fi,go=que.top().sec;
					que.pop();
					if(go==c) {
						ff=1;
						break;
					}
					rep(j,1,n) {
						if((leng[go]+glid[go][j])<leng[j]) {
							leng[j]=leng[go]+glid[go][j];
							que.push(PPAP(leng[j],j));
						}
					}
				}
				if(ff==0) cout<<"-1"<<endl;
				else cout<<leng[c]<<endl;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 3460
#include "bits/stdc++.h"
#include <random>
#define REP(i, n) for (ll i = 0; i < ll(n); ++i)
#define RREP(i, n) for (ll i = ll(n) - 1; i >= 0; --i)
#define FOR(i, m, n) for (ll i = m; i < ll(n); ++i)
#define RFOR(i, m, n) for (ll i = ll(n) - 1; i >= ll(m); --i)
#define ALL(v) (v).begin(), (v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end());
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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

using namespace std;

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  vi v = { 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 k;
  cin >> k;
  cout << v[k - 1] << endl;
}


Measured memory_bytes: 896
lines = gets.split('')

change_string = Array.new
lines.each_with_index do | line, i |
 if line == '?'
   if (lines.size >= i + 1) && ( line[i+1] == 'D') then
     change_string << 'P'
   else
     change_string << 'D'
   end
 else
   change_string << line
 end
end

puts change_string.join

Measured memory_bytes: 39948
while True:
    n=input()
    if n==0:break
    n=str(oct(n))
    S=[]
    for i in n[1:]:
        if i=="4":
            S.append("5")
        elif i>="5":
            S.append(str(int(i)+2))
        else:
            S.append(i)
    print "".join(S)

Measured memory_bytes: 4224
N = int(input())
s = tuple(input() for _ in range(N))

a, b, ba, ab = 0, 0, 0, 0
for ss in s:
    ab += ss.count('AB')

    bl_a = ss[-1] == 'A'
    bl_b = ss[0] == 'B'
    if bl_a:
        if bl_b:
            ba += 1
        else:
            a += 1
    else:
        if bl_b:
            b += 1
        else:
            pass

ans = 0
ans += ab

if ba > 0:
    # ba > 0
    ans += ba - 1
    if a > 0:
        ans += 1
        a -= 1
    if b > 0:
        ans += 1
        b -= 1

ans += min(a, b)
print(ans)

"""
...AB...
ab

B...A
ba

...A
a

B...
b
"""


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

const int MAXN=51;
int n; ll k;
ll p[MAXN],sum[MAXN];

ll calc(int n,ll k){
  if(n==0){
    if(k<=0) return 0;
    else return 1;
  }else if(k<=sum[n-1]+1){
    return calc(n-1,k-1);
  }else{
    return p[n-1]+1+calc(n-1,k-sum[n-1]-2);
  }
}

int main(){
  cin>>n>>k;
  sum[0]=1;
  p[0]=1;
  for(ll i=1;i<=n;i++){
    sum[i]=2*sum[i-1]+3;
    p[i]=p[i-1]*2+1;
  }
  cout<<calc(n,k)<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int num[1000005];

int main(void)
{   
    int s;
    cin >> s;

    int i = 1;
    int a = s;

    while(1) {
        if(num[a] == 1) break;
        num[a]++;
        if(a%2) a = 3*a + 1;
        else a /= 2;
        i++;
    }
    
    cout << i << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
using namespace std;

//ループマクロ
#define FOR(i , a , b)  for(int i = (a) ; i < (b) ; i++)
#define REP(i , n)      for(int i = 0 ; i < n ; i++)
#define REPR(i , n)     for(int i = n ; 0 <= i ; i--)
#define ROP(i, n)       for(int i = 1 ; i <= n ; i++)

//入出力
#define SCOUT(x) cout << (x) << " "
#define VECCIN(x) for(auto& ele : (x) ) cin >> ele
#define VECOUT(x) for(auto& ele : (x) ) cout << ele << " "; cout << endl;

//その他
#define ALL(obj) (obj).begin() , (obj).end() 
#define SORT(obj) sort(ALL(obj))
#define GSORT(obj) sort(ALL(obj) , greater<int>())
#define VLL vector<long long>
#define M map<int, int>
#define S set<int>
#define V vector<int>
#define PQ priority_queue<int>
#define PQG priority_queue<int , V , greater<int>>
ll gcd(int a, int b){
  if(a % b == 0)  return b;
  return gcd(b, a % b);
}
int main(void) {

	ios::sync_with_stdio(false);	cin.tie(0);
    int K;  cin >> K;
    ll ans = 0;
    ROP(i, K){
      ROP(j, K){
        ROP(k, K)  ans += gcd(gcd(i, j), k);
      }
    }

    cout << ans << endl;
  	return 0;
}


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

int main() {
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    if ((B < C) || (D < A)) cout << 0 << endl;
    else if (B <= D) {
        if (A <= C) cout << B - C << endl;
        else cout << B - A << endl;
    }
    else {
        if (C <= A) cout << D - A << endl;
        else cout << D - C << endl;
    }

    return 0;
}

Measured memory_bytes: 256
<?php

$arr = array();
$i = 0;
while (($line = trim(fgets(STDIN))) !== '0') {
    $n = (int)$line;
    $result = array();
    for ($j = 0; $j < $n; $j++) {
        fscanf(STDIN, '%s %d %d %d', $team, $win, $lose, $draw);
        $score = $win * 3 + $draw;
        if (!isset($result[$score])) {
            $result[$score] = array();
        }
        $result[$score][] = $team;
    }

    krsort($result);
    foreach ($result as $score => $arr2) {
        foreach ($arr2 as $team) {
            $arr[$i][] = sprintf('%s,%d%s', $team, $score, PHP_EOL);
        }
    }
    $arr[$i] = implode('', $arr[$i]);
    $i++;
}

echo implode(PHP_EOL, $arr);

Measured memory_bytes: 6676
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
string solve(bool a) { return ((a) ? "Yes" : "No"); }
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
template <class T, class U>ostream& operator<<(ostream& os, const pair<T, U>& p) {
    os << "(" << p.first << "," << p.second << ")";
    return os;
}
template <class T>ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "{";
    rep(i, v.size()) {
        if (i) os << ",";
        os << v[i];
    }
    os << "}";
    return os;
}
template <class T, class U>istream& operator>>(istream& is, pair<T, U>& p) {
    is >> p.first >>p.second ;
    return is;
}
template <class T>istream& operator>>(istream& is,  vector<T>& v) {
    rep(i, v.size()) {
        is >> v[i];
    }
    return is;
}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
    int n;
    cin >>n;
	vector<int> a(n);
	cin >> a;
	for (int i = n - 1; i >= 0;i--){
		for (int j = i * 2+1; j < n;j+=i+1){
			a[i] = (a[i] + a[j]) % 2;
		} }
	//clog << a << endl;
	Vi ans;
    rep(i,n){
        if(a[i]){
			ans.pb(i);
		}
    }
	cout << ans.size()<<endl;
	rep(i, ans.size()) { cout << ans[i]+1;
    if(i!=ans.size()-1){
		cout << " ";
	} }
	cout << endl;
}

Measured memory_bytes: 4476
def main():
    S = input()
    T = input()
    from collections import defaultdict
    st_dic = defaultdict(set)
    ts_dic = defaultdict(set)
    for s, t in zip(S, T):
        st_dic[s].add(t)
        ts_dic[t].add(s)
        if len(st_dic[s]) > 1 or len(ts_dic[t]) > 1:
            return print("No")
    print("Yes")


if __name__ == '__main__':
    main()


Measured memory_bytes: 41968
X=input()
from collections import deque
lt=deque()
r=0
ans=0
while r<len(X):
    if(X[r:r+2]=='ST'):
        ans+=2
        r+=2
        continue
    elif(len(lt)>0 and X[lt[-1]]+X[r]=='ST'):
        ans+=2
        lt.pop()
        r+=1
        continue
    if(X[r]=='S'):
        lt.append(r)
        r+=1
    else:
        r+=1
        lt.clear()

print(len(X)-ans)

Measured memory_bytes: 7512
import java.util.*;

class Main{
  public static int N;
  public static int[] A;
  public static int[] Check;
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    N = sc.nextInt();
    A = new int[N];
    for(int i=0;i<N;i++){
      A[i]=sc.nextInt();
    }
    int subR=N+1;
    Check = new int[N+1];
    for(int i = 0;i<N+1;i++){
      Check[i]=-1;
    }
    for(int i = 0;i<N;i++){
        if(A[i]==1){
          Check[1]=i;
          break;
        }
      }
    if(Check[1]!=-1){
    for(int checking=2;checking<=N;checking++){
      for(int i = Check[checking-1]+1;i<N;i++){
        if(A[i]==checking){
          Check[checking]=i;
          break;
        }
      }
      if(Check[checking]==-1){
        break;
      }
    }
  }
    for(int i = 0;i<N+1;i++){
      if(Check[i]!=-1){
        subR=i;
      }
    }
    System.out.println(N-subR);
  }
}

Measured memory_bytes: 60388
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;

main(){
	int n,m;
	while(cin>>n>>m){
		if(n==0 && m==0)break;
		
		vector<int> frie[n+1];
		int fr2[n+1];
		memset(fr2,-1,sizeof(fr2));
		
		for(int i=0;i<m;i++){
			int a,b;
			cin>>a>>b;
			frie[a].push_back(b);
			frie[b].push_back(a);
		}
		
		fr2[1]=0;
		queue<int> f1;
		for(int i=0;i<frie[1].size();i++){
			fr2[frie[1][i]]=1;
			f1.push(frie[1][i]);
		}
		
		while(!f1.empty()){
			int a=f1.front();f1.pop();
			for(int i=0;i<frie[a].size();i++){
				fr2[frie[a][i]]=2;
			}
		}
		fr2[1]=0;
		int ans=0;
		for(int i=1;i<=n;i++){
			if(fr2[i]>0)++ans;
			//cout<<i<<" "<<fr2[i]<<endl;
		}
		
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000000


int main(){
	int N;
	cin>>N;
	vector<long long> x(N);
	vector<long long> d(N-1);
	for(int i=0;i<N;i++){
		cin>>x[i];
		if(i!=0){
			d[i-1] = x[i] - x[i-1];
		}
	}
	
	
	
	long long M,K;
	cin>>M>>K;
		
	vector<long long> v(N-1);
	for(int i=0;i<N-1;i++){
		v[i]=i;
	}
	
	for(int i=0;i<M;i++){
		int b;
		cin>>b;
		swap(v[b-2],v[b-1]);
	}
	
	
	while(K!=0){
		if(K%2==1){
			
			vector<long long> dd(N-1);
			for(int i=0;i<N-1;i++){
				dd[i] = d[v[i]];
			}
			d=dd;
		}
		vector<long long> c=v;
		for(int i=0;i<N-1;i++){
			c[i] = v[c[i]];
		}
		v=c;
		K/=2;
	}
	
	for(int i=1;i<N;i++){
		x[i] = x[i-1] + d[i-1];
	}
	
	for(int i=0;i<N;i++){
		cout<<x[i]<<endl;
	}
	
	
	
	
	
	return 0;
}


Measured memory_bytes: 4336
/*
 * main.c
 *
 *  Created on: 2020/02/22
 *      Author: family
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a > b ? b : a)
typedef long long int ll;
typedef unsigned long long int ull;

int sort_inc(const void *a, const void *b) { return (*(int*)a - *(int*)b);}
int sort_dec(const void* a, const void* b) { return (*(int*)b - *(int*)a);}
int sort_dec_ll(const void *a, const void *b) {
    ll da = *(ll*)a, db = *(ll*)b;    int val = 0;
    if(da > db) { val = -1; }
    else if (da == db) { val = 0; }
    else { val = 1; }
    return val;
}
int sort_inc_ll(const void *a, const void *b) {
    ll da = *(ll*)a, db = *(ll*)b;    int val = 0;
    if(da > db) { val = 1; }
    else if (da == db) { val = 0; }
    else { val = -1; }
    return val;
}
int sort_dic(const void *a, const void *b) {
    char *pa = (char *)a;    char *pb = (char *)b;    int i = 0, val = 0, N = 10;
    for (i = 0; i < N; i++) {
    	char da = pa[i], db = pb[i];
    	if (da == db) continue;
  		if (da > db) val = 1; else val = -1;
        break;
    }
    return val;
}


int main()
{
	char S[11] = {0};
	int i = 0, len = 0, ans = 0;
	scanf("%s", S);
	len = strlen(S);
	if (len%2 != 0) {
		ans = 1;
	} else {
		for (i = 0; i < len; i += 2) {
			int ret = strncmp("hi", &S[i], 2);
			if (ret != 0) {
				ans = 1;
				break;
			}
		}
	}
	if (ans == 0) {
		printf("Yes\n");
	} else {
		printf("No\n");
	}
    return 0;
}


Measured memory_bytes: 128
// inputに入力データ全体が入る, 10)
function Main(input) {
	var N = parseInt(input.split('\n')[0].split(' ')[0], 10);
	var M = parseInt(input.split('\n')[0].split(' ')[1], 10);
	var X = parseInt(input.split('\n')[0].split(' ')[2], 10);
	var Y = parseInt(input.split('\n')[0].split(' ')[3], 10);
	var x = input.split('\n')[1].split(' ');
	var y = input.split('\n')[2].split(' ');
	var Z = [];
	var flag = false;
	x = x.map( val => parseInt(val, 10) );
	y = y.map( val => parseInt(val, 10) );
	for ( var i = X + 1; i <= Y; i++ ) {
		Z.push(i);
	}
	for ( var j = 0; j < Z.length; j++ ) {
		if ( Math.max(...x) < Z[j] && Z[j] <= Math.min(...y) ) {
			flag = true;
		}
	}
	if ( flag ) {
		console.log('No War');
	} else {
		console.log('War');
	}
}

// ※この行以降は編集しない (標準入力から一度に読み込みMainを呼び出します)
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 22060
use std::io;

fn gets() -> String {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).ok();
    buf
}

fn main() {
    let line = gets();
    let n = line.trim().parse::<usize>().unwrap();
    if n == 1 {
        println!("Hello World");
    } else {
        let line = gets();
        let a = line.trim().parse::<usize>().unwrap();
        let line = gets();
        let b = line.trim().parse::<usize>().unwrap();
        println!("{}", a + b);
    }
}


Measured memory_bytes: 4352
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd,numbers)

K = int(input())
ans = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans+=gcd(i,j,k)
print(ans)


Measured memory_bytes: 69656
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pb push_back
#define MEM(a, x) memset(a, x, sizeof a)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;

template<typename T> void dbg(T &x) {cerr << x << endl;}
template<typename T> void dbga(T &x, int &n) {for(int i = 0; i < n; i++) {cerr << i << ": "; cerr << x[i] << endl;} }
template<typename T> void dbgv(T &x) {bool first = true; cerr << "{"; for(auto i : x) {if(!first) cerr << ","; cerr << i; first = false;} cerr << "}" << endl;}

int n;
vector<pii> p;

double dist(pii a, pii b) {
	return sqrt( 1.0 * pow(a.first - b.first, 2) + 1.0 * pow(a.second - b.second, 2) );
}

int main() {
	ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	
	cin >> n;
	for(int i = 0; i < n; i++) {
		pii tmp;
		cin >> tmp.first >> tmp.second;
		p.pb(tmp);
	}

	sort(p.begin(), p.end());

	double sum = 0, cnt = 0;
	do {
		for(int i = 1; i < n; i++)
			sum += dist(p[i], p[i-1]);

		cnt++;

		dbg(sum);
	} while(next_permutation(p.begin(), p.end()));

	double ans = 1.0 * sum / cnt;

	cout << fixed << setprecision(6);
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
/*
int a[200010];
int n;
long long ans;

int main(){
    cin>>n;
    for(int i=1;i<=n;i++)
        scanf("%d",a+i);
    sort(a+1,a+n+1);
    ans=0;
    if(n%2){
        for(int i=1;i<=(n-3)/2;i++)
            ans+=2*(a[n-i+1]-a[i]);
        ans+=a[(n+3)/2]-a[(n-1)/2];
        ans+=max(a[(n+3)/2]-a[(n+1)/2],a[(n+1)/2]-a[(n-1)/2]);
    }else{
        for(int i=1;i<=n/2-1;i++)
            ans+=2*(a[n-i+1]-a[i]);
        ans+=a[n/2+1]-a[n/2];
    }
    cout<<ans<<endl;
    return 0;
}
*/

int s[1000][1000];
int n;
int k;
int main(){
    cin>>n;
    int m=2;
    bool flag=false;
    s[1][1]=1;
    k=1;
    while(k<100000){
        for(int i=1;i<=m-1;i++,k++)
            s[i][m-1]=s[m][i]=k;
        if(k-1==n){
            puts("Yes");
            printf("%d\n",m);
            for(int i=1;i<=m;i++){
                printf("%d ",m-1);
                for(int j=1;j<=m-1;j++)
                    printf("%d ",s[i][j]);
                putchar('\n');
            }
            flag=true;
        }
        m++;
    }
    if(!flag)
        puts("No");
    return 0;
}


Measured memory_bytes: 3200
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
  private static class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
      reader = new BufferedReader(new InputStreamReader(in));
      tokenizer = null;
    }

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

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

      return tokenizer.nextToken("\n");
    }

    public long nextLong() {
      return Long.parseLong(next());
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }

    public double nextDouble() {
      return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
      int[] a = new int[n];
      for (int i = 0; i < n; i++)
        a[i] = nextInt();
      return a;
    }

    public long[] nextLongArray(int n) {
      long[] a = new long[n];
      for (int i = 0; i < n; i++)
        a[i] = nextLong();
      return a;
    }
  }

  public static void main(String[] args) {
    FastScanner sc = new FastScanner(System.in);
    String b = sc.next();
    if (b.equals("A")) System.out.println("T");
    else if (b.equals("T")) System.out.println("A");
    else if (b.equals("C")) System.out.println("G");
    else System.out.println("C");
  }
}

Measured memory_bytes: 18900
#include "bits/stdc++.h"
#define PRECISION(x) cout << fixed << setprecision(x)
#define FAST_IO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define ALLR(X) (X).rbegin(), (X).rend()
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define F first
#define S second

using namespace std;
 
template<class T> void max_self(T & a, const T & b) { if(a < b) a = b; }
template<class T> void min_self(T & a, const T & b) { if(a > b) a = b; }
typedef long long LL;
const int INF = 1e9 + 7;
const double PI = acos(-1.0);
const double EPS = (1e-9);



int main(){
  FAST_IO  
  bool reverse = false;
  int N, maxIdx = 1, minIdx = 1; cin >> N;
  vector<int> nums(N + 1) ;
  nums[0] = -INF;
  for(int idx = 1; idx <= N; ++idx) cin >> nums[idx];

  for(int idx = 1; idx <= N; ++idx){
    if(nums[idx] > nums[maxIdx]) maxIdx = idx;
    if(nums[idx] < nums[minIdx]) minIdx = idx;
  }

  cout << 2 * N - 1 << "\n";

  auto util = [&](int crit){
    for(int idx = 1; idx <= N; ++idx){
      cout << crit << " " << idx << "\n";
    }
    return;
  };

  if(abs(nums[maxIdx]) < abs(nums[minIdx])){
    util(minIdx);
    reverse = true;
  }
  else util(maxIdx);


  if(reverse){
    for(int idx = N - 1; idx >= 1; --idx){
      cout << idx + 1 << " " << idx << "\n";
    }
  }else{
    for(int idx = 2; idx <= N; ++idx){
      cout << idx - 1 << " " << idx << "\n";
    }
  }
  return 0;
}

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

int main() {
  int N,i,a,ans;
  cin >> N;
  ans = 0;
  for(i=0;i<N;i++){
    cin >> a;
    while(a %2 == 0){
      a /= 2;
      ans++;
    }
  }
  cout << ans << endl;  
  return 0;
}



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

int main(){
  int N;
  cin >> N;
  vector<int> V(N+1,0);
  
  for(int x=1;x<=100;x++){
    for(int y=1;y<=100;y++){
      for(int z=1;z<=100;z++){
        int P = x*x+y*y+z*z+x*y+y*z+z*x;
        if(P<=N) V[P]++;
      }
    }
  }
  
  for(int i=1;i<=N;i++) cout << V[i] << endl;
  return 0;
}


Measured memory_bytes: 3596
function Main(input) {
    input = input.split("\n");
    var line = input[0].split(" ");
    var moji = line[0];
    if(moji.length%2===1){
        moji = moji.slice(0, -1);
    }
    
    while(1){
        moji = moji.slice(0, -2);
        var temp = moji.length;
        if(moji.substr(0,temp/2) === moji.substr(temp/2,temp)){
            break;
        }

        
    }
    
    console.log(moji.length);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 21192
N, K = map(int, input().split())
A = list(map(int, input().split()))

S = []
for l in range(0, N):
  temp = 0
  for r in range(l, N):
    temp += A[r]
    S.append(temp)

max_s = max(S)
n = max_s.bit_length()
S_temp = [S, []]
s_idx = 0
for i in range(n-1, -1, -1):
  c = 0
  for s in S_temp[s_idx]:
    if (s >> i) & 1:
      S_temp[s_idx-1].append(s)
      c += 1
  if c == K:
    ans = S_temp[s_idx-1][0]
    for _s in S_temp[s_idx-1]:
      ans &= _s
    print(ans)
    quit()
  if c > K:
    S_temp[s_idx] = []
    s_idx = not s_idx
  else:
    S_temp[s_idx-1] = []

ans = S_temp[s_idx][0]
for _s in S_temp[s_idx][:K]:
  ans &= _s

print(ans)

Measured memory_bytes: 27948
#include <cstdio>
#include <string>
#include <algorithm>

int main() {
  int N;
  scanf("%d", &N);

  if (N == 0)
    return !printf("0\n");

  std::string s;
  while (N) {
    if (N % 2) {
      s += '1';
      --N;
      N /= -2;
    } else {
      s += '0';
      N /= -2;
    }
  }

  std::reverse(s.begin(), s.end());
  printf("%s\n", s.c_str());
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define FI first
#define SE second
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<int>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define MOD 1000000007
#define INF 1000000007
using namespace std;
//
int main(){
  string S;
  cin>>S;
  int L=S.size();
  if(S[0]==S[L-1]){
    cout<<(L%2?"Second":"First")<<endl;
  }else{
    cout<<(L%2?"First":"Second")<<endl;
  }
  return 0;
}


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

bool check[1000005];//その数を使えるかどうかの判定します
int main() {
  int n;
  cin>>n;
  vector<int>a(n);
  map<int,int>mp;//2個以上あるのものを調べるのに使います
  for(int i=0;i<n;i++){
    cin>>a[i];
    check[a[i]]=1;
    if(mp.count(a[i]))mp.at(a[i])++;
    else mp[a[i]]=1;
  }
  int kotae=0;
  auto begin=mp.begin(),end=mp.end();
  for(auto iter=begin;iter!=end;iter++){
    int tmp=iter->first;//a[i]の重複なしの値
    int kazu=iter->second;//カウント
    if(kazu>1){//2個以上あるものをNGにします
      check[tmp]=0;
    }//else {//倍数をNGにします
      if(tmp*2<1000005){
        for(int i=tmp*2;i<1000005;i+=tmp){
          if(i>1000005)break;
          check[i]=0;
        }
      }
    //}
  }
  for(int i=0;i<n;i++){
    if(check[a[i]]==1)kotae++;//OKなものだけ数えます
  }
  cout<<kotae<<endl;   
  return 0;
}


Measured memory_bytes: 14184