akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<utility>
#include<algorithm>
#include<map>
typedef long long ll;
#define PB	push_back
#define FOR(n)			for(int i = 0; i < n; ++i)
#define RFOR(n)			for(int i = n; i >= 0; --i)
#define FORR(start,end) for(int i = start; i < end; ++i)
#define COUT(n)			cout << n << " " << flush
#define vi(v)			vector<int> v
#define vii(v)			vector<pair<int,int>> v
#define mii(m)			map<int, int> m
#define msi(m)			map<string, int, less<>> m
#define mmsi(m)			multimap<string, int, less<>> m
#define mkp(a,b)		make_pair(a,b)
#define ALL(obj)		obj.begin(), obj.end()
#define PI 3.141592
#define MOD 1e9+7
using namespace std;

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

	if (n%2 != 0)
	{
		printf("No\n");
		return 0;
	}

	for (int i = 0; i < n / 2; ++i) {
		if (s[i] != s[n / 2 + i])
		{
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
//const ll MOD=(ll)1e9+7;
const ll MOD=(ll)998244353;
const ll INF=(ll)1e18+10;
const double PI = 2.0*acos(0);

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int dy[]={-1,1,0,0};
int dx[]={0,0,-1,1};

ll dp[3010][3010][3];

void solve(int ca){
    memset(dp,0, sizeof(dp));
    int N,S; cin>>N>>S;
    vector<int> a(N);
    for(int i=0;i<N;++i){
        cin>>a[i];
    }
    dp[0][0][0]=1;
    for (int i = 0; i < N; ++i) {
        for (int j = 0; j <= S; ++j) {
            //f==0
            (dp[i+1][j][0]+=dp[i][j][0])%=MOD;
            (dp[i+1][j][1]+=dp[i][j][0])%=MOD;
            (dp[i+1][j][2]+=dp[i][j][0])%=MOD;
            //f==1
            (dp[i+1][j][1]+=dp[i][j][1])%=MOD;
            (dp[i+1][j][2]+=dp[i][j][1])%=MOD;
            //f==2
            (dp[i+1][j][2]+=dp[i][j][2])%=MOD;

            if(j+a[i]<=S){
                (dp[i+1][j+a[i]][1]+=dp[i][j][0])%=MOD;
                (dp[i+1][j+a[i]][1]+=dp[i][j][1])%=MOD;
                (dp[i+1][j+a[i]][2]+=dp[i][j][0])%=MOD;
                (dp[i+1][j+a[i]][2]+=dp[i][j][1])%=MOD;
            }

        }
    }
    cout<<dp[N][S][2]<<endl;
}

//#define MULTI
int main() {
#ifdef MULTI
    int N; cin>>N;
    for (int i = 0; i < N; ++i) {
        solve(i+1);
    }
#else
    solve(0);
#endif
    return 0;
}


Measured memory_bytes: 212608
#include<stdio.h>
int main(void){
    int x;
    int jyuu;
    int hyaku;
    int sen;
    scanf("%d",&x);
    
    for(int i=1;i<=x;i++){
        sen=i/1000;
        hyaku=(i-sen*1000)/100;
        jyuu=((i-sen*1000)-hyaku*100)/10;
        
        if(i%3==0||i%10==3||i%100==3||i%1000==3){
            printf(" %d",i);
        }
        else if(sen==3||hyaku==3||jyuu==3){
            printf(" %d",i);
        }
        
    }
    printf("\n");
    return 0;
}


Measured memory_bytes: 2052
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define sz(a) (ll)(a.size())
const ll mod = 998244353;
const ll MAX = 100005;
ll n , k;
vector<pair<ll , pair<ll , ll> > > ans;
int main()
{	
	cin >> k >> n;
	set<ll> s1 , s2;
	for(ll i = n; i < n + k; i++) s1.insert(i);
	for(ll i = n + k; i < n + 2 * k; i++) s2.insert(i);
	for(ll i = n + 2 * k; i < n + 3 * k; i++)
	{
		if(*s1.begin() <= (*s2.begin() - k))
		{
			auto it = s2.upper_bound(i - *s1.begin());
			if(it == s2.begin()){cout << -1;return 0;}
			it--;
			ans.pb({*s1.begin() , {*it , i}});
			s1.erase(*s1.begin());
			s2.erase(it);
		}
		else
		{
			auto it = s1.upper_bound(i - *s2.begin());
			if(it == s1.begin()){cout << -1;return 0;}
			it--;
			ans.pb({*s2.begin() , {*it , i}});
			s2.erase(*s2.begin());
			s1.erase(it);
		}
	}
	
	
	
	for(auto x : ans)
		cout << x.x << " " << x.y.x << " " << x.y.y << endl;
}


Measured memory_bytes: 14448
#include<iostream>
using namespace std;
#include<map>
#include<set>
#include<algorithm>
#include<vector>
#include<cmath>
#define int long long int
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int n;
	cin>>n;
	int arr[n],j;
	for(j=0;j<n;j++)
	   cin>>arr[j];
	sort(arr,arr+n);
	int prod=1;
	bool result=false;
	for(j=0;j<n;j++)
	{
		int x=pow(10,18);
		if(prod==0)
		{
			break;
		}
		if(arr[j]>x/prod)
		{
			result=true;
			break;
		}
		else
		{
			prod*=arr[j];
		}
	}
	if(result)
	{
		cout<<-1<<endl;
	}
	else
	  cout<<prod<<endl;
}


Measured memory_bytes: 4436
#include <bits/stdc++.h>
#include <iomanip>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
 
const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}
ll lcm(ll x,ll y){
  ll g=gcd(x,y);
  return x/g*y;
}


int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  
  int n; cin>> n;
  vector<int>d(n);
  int sum=0;
  rep(i,n) cin >> d[i];
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      sum+=d[i]*d[j];
    }
  }
  cout<<sum<<endl;
  
}

Measured memory_bytes: 256
#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SORT(V);REV(V) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define Yay(n) cout << ((n) ? "Yay!" : ":(") << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(i, (V).size()) {cout << (V)[i] << endl;}
#define VOUT2(V) REP(i, (V).size()) {cout << (V)[i] << " ";} cout<<endl;

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define Vd vector<double>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
//

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

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

// デフォルト変数定義
int n,m,a,b,c,x,y,z;
double d,e,f;
string s,t;
//

signed main() {
  RAPID;
  IN3(n,a,b);
  if(n==1) OUT("Hello World");
  else OUT(a+b);
}

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


using namespace std;

typedef long long ll;






string s;

ll bt(int x, ll sum) {
	if (x == s.size())
		return sum;
	ll ret = 0;
	for (int i = x + 1; i <= s.size(); i++)
		ret += bt(i, stoll(s.substr(x, i - x)) + sum);
	return ret;
}


int main() {
	cin >> s;
	cout << bt(0, 0);
	return 0;
}

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define VI         vector<int>
#define MOD 1000000007

typedef long long int ll;

const ll INF=(ll)1e19;
//const int INF=(1<<30);


int main(){
  int N;
  cin >> N;
  VI a(N);
  REP(i,N){
    cin >>a[i];
    a[i] -= i+1;
  }
  sort(ALL(a));

  ll mid = 0;
  if(N%2!=0){
    mid = a[N/2];
  }else{
    mid = round((a[N/2] + a[N/2-1])/2.0);
  }

  ll ans=0;
  REP(i,N){
    ans += abs(a[i]-mid);
  }
  cout << ans << endl;
}



Measured memory_bytes: 1024
inf = 10 ** 15
mod = 10 ** 9 + 7
h,w = map(int, input().split())
a = [list(map(int, input().split())) for i in range(h)]
ans = []
for i in range(h):
    if i%2 == 0:
        for j in range(w-1):
            if a[i][j] != 0:
                if a[i][j]%2 == 1:    # 奇数だった
                    ans.append([i,j,i,j+1])
                    a[i][j]-=1
                    a[i][j+1]+=1
        if i < h-1 and a[i][w-1]%2 == 1:
            ans.append([i, w-1, i+1, w-1])
            a[i][w-1]-=1
            a[i+1][w-1]+=1
    else:
        for j in range(w-1):
            if a[i][w-1-j]%2 == 1:
                ans.append([i,w-1-j,i,w-1-j-1])
                a[i][w-1-j]-=1
                a[i][w-1-j-1]+=1
        if i < h-1 and a[i][0]%2 == 1:
            ans.append([i,0,i+1,0])
            a[i][0]-=1
            a[i+1][0]+=1
print(len(ans))
for x,y,nx,ny in ans:
    print('{} {} {} {}'.format(x+1,y+1,nx+1,ny+1))

Measured memory_bytes: 67548
// Author : Nachiket Kanore
// Institute : PICT, Pune

/* It does not matter how slowly you go as long as you do not stop.*/

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define endl '\n'
#define rep(x,s,e) for(int x=s;x<=(e);x++)
#define repn for(int x=0;x<n;x++)
#define rep1n for(int x=1;x<=n;x++)
#define rep1m for(int y=1;y<=m;y++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define precise(x) cout << fixed << setprecision(x)
#define bits(x) __builtin_popcount(x)
#define pb push_back
#define mp make_pair
#define test int t; cin>>t; while(t--)
#define FAST                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)

typedef vector<int> vi;
typedef vector<pair<int,int>> vii;
typedef pair<int,int> pii;


void __print(int x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}


template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define see(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define see(x...)
#endif

const int inf = 1e18;
const int N = 1005;



int32_t main(){
    FAST;

   int a , b , c;   cin >> a >> b >> c;
   cout << ((b - a == c - b) ? "YES" : "NO") << endl;

    return 0;
}




Measured memory_bytes: 256
//package  com.company;

import java.util.Scanner;

public class Main{

    public static void main(String[] args) {
       Scanner sc=new Scanner(System.in);
       int number=sc.nextInt();
       int val=number/1000;
       if(number%1000!=0){
           val+=1;
       }else{

       }
        System.out.println(1000*val-number);
    }
}

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

#define int long long
#define mod 1000000007
#define p pair<int,int>
#define MAX 1000010

using namespace std;

int a[MAX],b[MAX];
bool vis[MAX];

vector <int> v;
vector <p> vp;
set <int> s;
set <p> sp;
map <int,int> m;
unordered_map <int,int> um;
queue <int> bq;

int32_t main()
{
    um.reserve(1<<15);
    um.max_load_factor(0.25);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int a[3];

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

    sort(a,a+3);

    cout << a[2]*10 + a[1] + a[0] << endl;

    return 0;
}

Measured memory_bytes: 512
import java.util.*;

class Main{           
  
   public static void main(String[] args){
         Scanner sc = new Scanner(System.in);  
         
         HashSet<Character> left = new HashSet<Character>();
         HashSet<Character> right = new HashSet<Character>();
         
         left.add('q');
         left.add('w');
         left.add('e');         
         left.add('r');         
         left.add('t');                  
         left.add('a');                           
         left.add('s');                                    
         left.add('d');                                             
         left.add('f');                                                      
         left.add('g');                                                               
         left.add('z');                                                                        
         left.add('x');                                                                                 
         left.add('c');                                                                                          
         left.add('v');                                                                                                   
         left.add('b');                                                                                                                     
         right.add('y');
         right.add('u');
         right.add('i');         
         right.add('o');                  
         right.add('p');                           
         right.add('h');                                    
         right.add('j');                                             
         right.add('k');                                                      
         right.add('l');                                                               
         right.add('n');                                                                        
         right.add('m');                                                                                 
         
         while(true){
             
             String n = sc.next();
             
             if(n.equals("#")){
                 break;
             }else{
                 boolean leftflag = false;
                 boolean rightflag = false;
                 int count = 0;
                 for(int i = 0;i < n.length();i++){
                     char a = n.charAt(i);
                     if(!leftflag && left.contains(a)){
                         rightflag = false;
                         count++;
                         leftflag = true;
                     }else if(!rightflag && right.contains(a)){
                         leftflag = false;
                         count++;
                         rightflag = true;
                     }                     
                 }    
                 System.out.println(count-1);
             }
             
         }
                 
   }         
         
 }
  

Measured memory_bytes: 27608
#include<bits/stdc++.h>
using namespace std;
 
int main()
{
  long long int n,k,ans=0,mod=1000000007;
  cin>>n>>k;
  for(long long int i=k;i<=n+1;i++)
  {
    ans=(ans+i*(n+1-i)+1);
    ans=ans%mod;
  }
  cout<<ans;
  
  return 0;
  
}

Measured memory_bytes: 3608
n,ma,mb=map(int,input().split())
abc=[]
for i in range(n):
    abc.append([int(j) for j in input().split()])
from operator import itemgetter
abc.sort(key=itemgetter(2))

dp=[[10**18 for i in range(401)]for j in range(401)]
dp[0][0]=0

p,q=0,0
for a,b,c in abc:
    for j in reversed(range(q+1)):
        for i in range(p+1):
            if dp[i][j]==10**18:
                continue
            else:
                dp[i+a][j+b]=min(dp[i+a][j+b],dp[i][j]+c)
    p+=a
    q+=b

ans=1145141919
i=1
while ma*i<401 and mb*i<401:
    ans=min(ans,dp[ma*i][mb*i])
    i+=1
if ans==1145141919:
    print(-1)
else:
    print(ans)





Measured memory_bytes: 4852
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int main(){
	int n;string a,b,c;cin>>n>>a>>b>>c;
	int ans=0;
	rep(i,n){
		map<char,int>mp;
		mp[a[i]]++;
		mp[b[i]]++;
		mp[c[i]]++;
		int Max=0;
		for(auto p:mp)Max=max(Max,p.second);
		ans+=3-Max;
	}
	cout<<ans<<endl;
}

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

int main() {
    int n, m, a, b; cin >> n >> m >> a >> b;

    string line = string(a, '0') + string(m - a, '1');
    string other = string(a, '1') + string(m - a, '0');

    for(int i = 0; i < b; i += 1)
        cout << line << "\n";
    for(int i = b; i < n; i += 1)
        cout << other << "\n";
}

Measured memory_bytes: 1280
n=int(input())
a=[]
b=[]

for i in range(n):
  x,y=map(int,input().split())
  a+=[x]
  b+=[y]
  
a.sort()
b.sort()

if n%2==1:
  print(b[n//2]-a[n//2]+1)
  
else:
  print((b[n//2]+b[n//2-1])-(a[n//2]+a[n//2-1])+1)

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
using vvll = vector< vector<ll> >;
using vll = vector<ll> ;    
using pll = pair<ll, ll> ;

#define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define I insert
#define ar array
#define endl '\n'
#define all(x) x.begin(), x.end()
#define sz(x) ((long long)x.size())


template<typename T> void umin(T& a,T b){a = min(a,b);}
template<typename T> void umax(T& a,T b){a = max(a,b);}

const ll maxs = 1e6+5;
const ll lmaxs = 20;
ll mod = 1e9+7;
ll oo = 1e15;

ll fast(ll x,ll y){
    ll res=1;
    while(y){
        if(y&1)
            res = (res*x)%mod;
        x = (x*x)%mod;
        y >>= 1;
    }
    return res;
}

ll inv(ll n){
    return fast(n,mod-2);
}


void pre(){


}

void solve(){    

    string s;
    cin >> s;
    int sum=0;
    for(auto ch : s){
        sum += ch-'0';
    }
    if(sum%9){
        cout << "No";
    }else{
        cout << "Yes";
    }

}

int32_t main(){
    #ifndef ONLINE_JUDGE
    freopen("input00.txt","r",stdin);
    #endif
    IOS;
    pre();
    ll T = 1;
    //cin >> T;
    while(T--){
        solve();   
    }
    return 0;
}

Measured memory_bytes: 3708
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		long x = sc.nextLong();
		long y = sc.nextLong();
		int ans = 1;

		while ((x * 2) <= y) {
			ans++;
			x = x * 2;
		}

		System.out.println(ans);

		sc.close();
	}
}


Measured memory_bytes: 23764
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
using namespace std;
typedef long long ll;

int N;
int a, b;

int main(){
  cin >> N;
  if (N==1) cout << "Hello World" << endl;
  else{
    cin >> a >> b;
    cout << a + b << endl;
  }
}


Measured memory_bytes: 3588
from fractions import gcd
N = int(input())
if N >=2:
    A = [int(input()) for _ in range(N)]
    B = [0]*(N-1)
    B[0] = (A[0]*A[1])//gcd(A[0], A[1])
    for i in range(N-2):
        B[i+1] = (A[i+2]*B[i])//gcd(A[i+2], B[i])
    ans = B[N-2]
else:
    ans = int(input())
print(ans)


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i) >> b.at(i);
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  if (n % 2 == 1) {
    cout << b.at(n / 2) - a.at(n / 2) + 1 << endl;
  } else {
    cout << b.at(n / 2 - 1) + b.at(n / 2) - a.at(n / 2 - 1) - a.at(n / 2) + 1 << endl;
  }
}


Measured memory_bytes: 4840
#include <iostream>

using namespace std;

double n, k, p, now;

int main()
{
	cin >> n >> k;
	for (double i = 1; i <= n; i++)
	{
		double x = i;
		now = 1;
		while (x < k)
		{
			x *= 2;
			now *= 0.5;
		}
		p += now;
	}
	p/=n;
	printf("%.12f", p);
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int N, M, L, d[301][301], a, b, c, Q, s, t;
#define rep(i, n) for(auto i = 0; i < n; i++)
#define rep1(i, n) for(auto i = 1; i <= n; i++)

void wf() {
  rep1(k, N) rep1(i, N) rep1(j, N) if(d[i][j] > d[i][k] + d[k][j]) d[i][j] = d[i][k] + d[k][j];
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> M >> L;
  rep1(i, N) rep1(j, N) d[i][j] = L + 1;
  rep(i, M) {
    cin >> a >> b >> c;
    d[a][b] = d[b][a] = c;
  }
  wf();
  rep1(i, N) rep1(j, N) d[i][j] = d[i][j] <= L ? 1 : L + 1;
  wf();
  cin >> Q;
  rep(i, Q) {
    cin >> s >> t;
    cout << (d[s][t] > L ? -1 : d[s][t] - 1) << "\n";
  }
}

Measured memory_bytes: 896
rc = [int(i) for i in input().split()]
data = []

for i in range(rc[0]):
    sum_c = [int(i) for i in input().split()]
    sum_c.append(sum(sum_c))
    data += [sum_c]
    print(" ".join(map(str,sum_c)))

hoge = [[row[i] for row in data] for i in range(rc[1])]

sum_r = [sum(hoge[i]) for i in range(rc[1])]
sum_r.append(sum(sum_r))
print(" ".join(map(str,sum_r)))

Measured memory_bytes: 7808
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import permutations
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7


#############
# Main Code #
#############

N = getN()
A = getList()

r, tmp = 0, 0
# l:左端
cnt = 0
for l in range(N):
    while r < N and tmp ^ A[r] == tmp + A[r]:
        # 右端を伸ばす
        tmp += A[r]
        r += 1
    # 計算
    # r を一個進めて条件を満たさなくなった時点でループを終了しているので
    # (r - l + 1) - 1
    cnt += r - l

    if l == r:
        r += 1
        tmp -= A[l]
    else:
        tmp -= A[l]
print(cnt)

Measured memory_bytes: 95288
#include<stdio.h>

int ketanowa(int i){
	int sum=0;
	
	while(i>0){
			sum=sum+i%10;
			i=i/10;
		}
	
	return sum;
}




int main(){
	
	int N,A,B,i,j,sum,total=0;
	scanf("%d%d%d",&N,&A,&B);
	
	for(i=1;i<=N;i++){
		
		sum=ketanowa(i);
		if(A<=sum&&sum<=B){
			total=total+i;
			
		}
		
		
	}
	
	
	
	printf("\n%d\n\n",total);
	
	
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
 
using namespace std;
typedef long long ll;
 
 
typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする
 
vector<ll> G[100005];
vector<P> tree[100010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll>> pqls;
priority_queue <P,vector<P>,greater<P>> pqps;
//small priority queue
//top pop

int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
 
#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<x;
#define re(i,a,b) for(i=a;i<=b;i++);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
 
ll rui(ll abc,ll bed){
	//aのb乗を計算する
	if(bed==0){return 1;}
	else{
		ll ced = rui(abc,bed/2);
		ced *= ced;
		ced %= mod;
		if(bed%2==1){ced*=abc; ced%=mod;}
		return ced;
	}
} 
ll i,j,k,ii,jj;
ll n,m,sum,num;
ll ans;
ll a,b,d,e,f,g,h,w;
 
ll x[800005],y[800005],z[900005];
char s[500005];
ll dp[5000][5000];

int main(){
    cin>>n>>m>>k;
	for(i=0;i<m;i++){
		cin>>a>>b;
		dp[a][b]++;
	}
	
	for(i=0;i<n+3;i++){
		for(j=0;j<n+3;j++){
			dp[i+1][j] += dp[i][j];
		}
	}
	for(i=0;i<n+3;i++){
		for(j=0;j<n+3;j++){
			dp[i][j+1] += dp[i][j];
		}
	}
	
	
	for(i=0;i<k;i++){
		cin>>a>>b;
		p(dp[n][b]-dp[a-1][b]);
	}
	return 0;
}

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

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


//ABC079_c
int main() {
	string s;
	cin >> s;

	for (int tmp = 0; tmp < (1 << 3); tmp++) {
	    bitset<3> op(tmp);

		int sum = s[0] - '0';
		string ans = "";
		ans.append(s.substr(0, 1));
		for (int i=1; i<s.size(); i++) {

			if (op[i-1]==0) {
				sum += s[i] - '0';
				ans += "+";
			}
			else {
				sum -= s[i] - '0';
				ans.append("-");
			}
			ans += s.substr(i, 1);
		}
		if (sum == 7) {
			ans += "=7";
			cout << ans << endl;
			return 0;
		}
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef unsigned long long LL;
typedef pair<int,int> P;
const LL mod=1000000007;
const LL LINF=1LL<<62;
const LL INF=1<<17;


LL dp[101][1000];

int main(){
    LL N;cin >> N;
    vector<LL> v(101,0);
    for (int i = 2; i <= N; i++) {
        int t=i;
        for (int j = 2; j <= N; j++) {
            while(t%j==0){
                v[j]++;
                t/=j;
            }
        }
    }
    dp[0][1]=1;
    for (int i = 0; i <= N; i++) {
        for (int j = 1; j < 75; j++) {
            for (int k = 0; k <= v[i]; k++) {
                if(j*(k+1)<=75) dp[i+1][j*(k+1)]+=dp[i][j];
            }
        }
    }
    LL ans=0;
    for (int i = 0; i <= N; i++) {
        ans+=dp[i][75];
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 768
#include <algorithm>
#include <climits>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <vector>

#define int long long int
constexpr int INF = std::numeric_limits<int>::max();
constexpr int NINF = std::numeric_limits<int>::min();
using namespace std;

bool odd(vector<int> &v) {
  for (auto &a: v) {
    if (a %2 == 1) {
      return true;
    }
  }
  return false;
}

void solve() {
  vector<int> v(3), w(3);
  cin >> v[0] >> v[1] >> v[2];

  int ans = 0;
  while (true) {
    if (odd(v)) {
      break;
    }

    if (v[0] == v[1] && v[1] == v[2]) {
      ans = -1;
      break;
    }

    for (int i = 0; i < 3; i++) {
      w[(i + 1)%3] += v[i]/2;
      w[(i + 2)%3] += v[i]/2;
    }

    ans++;
    v = w;
    w = vector<int>(3);
  }

  cout << ans << endl;
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}


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

using namespace std;

bool reversible(const string& s) {
    bool reversible = true;
    int n = s.size();
    for (int i = 0; i < n; ++i) {
        if (s[i] != s[n - 1 - i]) {
            reversible = false;
        }
    }
    return reversible;
}

int main() {
    string S;
    cin >> S;

    int n = S.size();
    int halfn = (n - 1) / 2;
    string former = S.substr(0, halfn);
    string latter = S.substr(1 +  halfn, halfn);

    bool strongReversible = reversible(S) && reversible(former) && reversible(latter);
    cout << (strongReversible ? "Yes" : "No") << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define pb push_back
#define ld long double
#define f first
#define s second
#define in insert
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e18 + 5;
const int mod = 1e9 + 7;
const int  N = 2e5 + 314;
const long double pi = 3.1415926535897932384626433832795;
void solve(){
    int n;
    cin>>n;
    vi v(n);
    int ans = 1000, k = 1;
    for(int i = 0; i < n; i++)cin>>v[i];
    for(int i = 1; i < n; i++){
        if(v[i]!=v[i-1])v[k++]=v[i];
    }
    v.resize(k);
    int s = 1000, cnt = 0, i = 0;
    while(i<k)
    {
        while(v[i]>v[i+1]&&i<k-1)i++;
        cnt=s/v[i];
        s-=cnt*v[i];
        while(v[i]<v[i+1]&&i<k-1)i++;
        s+=cnt*v[i];
        i++;
    }
    cout<<s;
}
signed main(){
    speed;
    int t=1;
    //cin>>t;
    while(t--)solve();
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
#include <cstring>
using namespace std;
int main(){
	char a[3],b[3],c[7];
	while(cin>>a>>b){
		int lena = strlen(a);
		int lenb = strlen(b);
		for(int i=0; i<lena; ++i)c[i]=a[i];
		for(int i=0; i<lenb; ++i){
			c[lena]=b[i];
			lena++;
		}
		int x=atoi(c);
		if(sqrt(x)==(int)sqrt(x))cout<<"Yes"<<endl;
		else cout<<"No"<<endl;

	}
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>

int main()
{
	int W,a,b;
	scanf("%d%d%d",&W,&a,&b);
	printf("%d\n",abs(a-b)-W>0?abs(a-b)-W:0);
	return 0;
 } 

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#define int long long
using namespace std;
int dp[1001][1001],N,M,D[1002],C[1002],ans=1000000000;
signed main(){
    cin>>N>>M;
    fill(dp[0],dp[0]+1001*1001,1000000000);
    fill(D,D+1002,10000);
    fill(C,C+1002,10000);
    for(int i=0;i<N;i++){
        cin>>D[i];
    }
    for(int i=0;i<M;i++){
        cin>>C[i];
    }
    dp[0][0]=0;
    for(int i=0;i<N;i++){
        for(int j=0;j<M;j++){
            dp[i+1][j+1]=min(dp[i+1][j+1],dp[i][j]+D[i]*C[j]);
            dp[i][j+1]=min(dp[i][j+1],dp[i][j]);
        }
    }
    for(int i=0;i<=M;i++){
        ans=min(ans,dp[N][i]);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 9004
#include <stdio.h>

int main(void) {
    double n;
    int eve = 0;
    int odd = 0;
    double t = 0;
    
    scanf("%lf", &n);


    for (int k = 1; k <= n; k++) {
        if (k%2 == 1) {
            odd++;
        } else {
            eve++;
        }
    }
    t = odd/n;

    printf("%.10f\n", t);

    return 0;

}

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

#define INF 1000000007
#define mem(dp,a) memset(dp,a,sizeof dp)
#define flash ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
#define f(i,n) for (ll i=0;i<n;i++)
#define sieve(j,mp) for(ll j=2*i ; j<=mp ; j+=i)
#define pb(x) push_back(x)
#define mp(x,y) push_back(make_pair(x,y))
#define tr(c,it) for(((c).begin())it=(c).begin();it!=(c).end();it++)
#define test ll t=1; while(t--)
#define F first
#define S second
main()
{
    flash
    clock_t launch=clock();
    test
    {
        int n,v;
        cin>>n;
        int dp[n+1],a[n+1];
        mem(dp,0);
        rep(i,1,n+1)
        cin>>a[i];
        dp[1]=0;
        dp[2]=abs(a[2]-a[1]);
        rep(i,3,n+1)
        dp[i]=min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i-2]-a[i]));
        cout<<dp[n]<<endl;
    }
    clog<<((long double)(clock()-launch)/CLOCKS_PER_SEC)<<"\n";
    return 0;
}


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

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define spa << " " <<
#define MP make_pair
ll MOD = 1e9+7;
//ll MOD = 998244353;
ll INF = 1e18;
void chmin(ll &a, ll b) { if (a > b) a = b; }
void chmax(ll &a, ll b) { if (a < b) a = b; }
void answer1(bool x){
  if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void answer2(bool x){
  if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void answer3(bool x){
  if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
void answer(bool x, ll y, ll z){
  if(x) cout<<y<<endl;else cout<<z<<endl;}   


int main(){
  ll i, j;
  //ll n,x;
  //cin >> n >> x;
  ll n,c;
  cin>>n>>c;
  //string s; cin >> s;
  ll result =0;
  ll bufl=0,bufr=0,buflr=0,bufrl=0;
  vector<ll> maxr(n+1),maxl(n+1);
  vector<ll> x(n+2),v(n+2),l(n+1),r(n+1),lr(n+1),rl(n+1);
  for(i=0;i<n;i++){
    cin>>x[i+1]>>v[i+1];
  }
  x[n+1]=c;v[n+1]=0;
  for(i=1;i<=n;i++){
    r[i]=v[i]-(x[i]-x[i-1])+r[i-1];
    rl[i]=v[i]-(x[i]-x[i-1])*2+rl[i-1];
    chmax(bufr,r[i]);
    maxr[i]=bufr;
  }
  reverse(ALL(x));
  reverse(ALL(v));
  for(i=1;i<=n;i++){
    l[i]=v[i]-abs(x[i]-x[i-1])+l[i-1];
    lr[i]=v[i]-abs(x[i]-x[i-1])*2+lr[i-1];
    chmax(bufl,l[i]);
    maxl[i]=bufl;
  }

  for(i=1;i<=n;i++){
    chmax(buflr,lr[i]+maxr[n-i]);
    chmax(bufrl,rl[i]+maxl[n-i]);
    //cout<<r[i] spa l[i] spa rl[i] spa lr[i] 
    //spa maxl[i] spa maxr[i] << endl;
  }
  cout<<max({bufr,bufl,buflr,bufrl})<<endl;
  return 0;
}

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

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

using namespace std;

// data
int n;
const int MAX_N = 5e5;
int a[MAX_N];
int aux[MAX_N];

int64_t merge_sort(int a[], int il, int ir);
int main()
{
    cin >> n;
    rep(i, n) cin >> a[i];

    int64_t inv_cnt = merge_sort(a, 0, n);
    cout << inv_cnt << endl;
}

int64_t merge(int *a, int l, int m, int r)
{
    int il = l, ir = m;
    int64_t cnt = 0;
    REP(i, l, r)
    {
        if (il < m && a[il] < a[ir] || ir >= r)
            aux[i] = a[il++];
        else{
            aux[i] = a[ir++];
            cnt += m - il;
        }

    }

    REP(i, l, r) a[i] = aux[i];
    return cnt;
}

int64_t merge_sort(int a[], int il, int ir)
{
    if (ir - il <= 1)
        return 0;

    int mid = (il + ir) / 2;

    int64_t inv_cnt = 0;
    inv_cnt += merge_sort(a, il, mid);
    inv_cnt += merge_sort(a, mid, ir);
    inv_cnt += merge(a, il, mid, ir);

    return inv_cnt;
}



Measured memory_bytes: 4648
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define LEN 100005

typedef struct pp{
    char name[100];
    int time;
}P;

int head, tail;
P Q[LEN];

void enqueue(P x){
    Q[tail] = x;
    tail = (tail + 1) % LEN;
}

P dequeue(){
    P x = Q[head];
    head = (head + 1) % LEN;
    return x;
}

int main(){
    int n, q;
    long Time = 0;
    P u;
    scanf("%d %d", &n, &q);
    int i;
    for(i = 0; i < n; i++){
        scanf("%s %d", Q[i].name, &Q[i].time);
    }
    head = 0;
    tail = n;
    while(head != tail){
        u = dequeue();
        if(u.time <= q){
            Time += u.time;
            printf("%s %ld\n", u.name, Time);
        }else{
            Time += q;
            u.time -= q;
            enqueue(u);
        }
    }
    return 0;
}


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

int main()
{
    string s ;
    int sum, total ;
    bool one ;
    while(cin >> s)
    {
        one = false ;
        sum = 0 ;
        for(int i=0; i<s.length(); i++)
        {
            if(s[i]-'0' != one) sum++ ;
            one = !one ;
        }
        one = true ;
        total = 0 ;
        for(int i=0; i<s.length(); i++)
        {
            if(s[i]-'0' != one) total++ ;
            one = !one ;
        }
        cout << min(total, sum) << '\n' ;
    }
    return 0 ;
}


Measured memory_bytes: 512
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <numeric>
#include <bitset>
#include <cmath>

using namespace std;
using ll = long long;
// const ll mod =  998244353 ;
const ll mod =  1000000007 ;
const ll inf = 1e18;

#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP_FROM(i, j, n) for (ll i = (j); i < (n); ++i)
#define all(x) (x).begin(),(x).end()
#define sz(x) int(x.size())

template<typename T> void print_vec(vector<T> a) {int n = a.size();REP(i, n) {cout >> a[i]; if(i!=n-1) cout << " "; else cout << endl;}}
ll power(ll base, ll exponent){ if(exponent % 2){ return power(base, exponent - 1) * base % mod; }else if(exponent){ ll root_ans = power(base, exponent / 2); return root_ans * root_ans % mod; }else{ return 1; }}
ll inverse(ll x){ return power(x, mod - 2);}
ll gcd(ll a, ll b) {if(a < b) gcd(b, a);ll r;while(r=a%b) {a=b;b=r;}return b;}
template<typename T> ll sum(T begin, T end) {return accumulate(begin, end, 0ll);}
struct combination{ vector<ll> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } ll C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };

struct Node {
  int a;
  int b;
  Node *child;
  Node(int _a, int _b) : a(_a), b(_b) {
    child = nullptr;
  }
    Node(int _a, int _b, Node *_child) : a(_a), b(_b), child(_child) {
  }
};
signed main() {
  ios::sync_with_stdio(false);
  ll n, m;
  cin >> n >> m;
  priority_queue<ll> a;
  REP(i, n) {
    ll b;
    cin >> b;
    a.push(b);
  }
  while(m--) {
    ll c = a.top();a.pop();
    a.push(c/2);
  }
  ll ans = 0;
  while(a.size()) {
    ans += a.top();a.pop();
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1400
package main

import "fmt"

func main() {
	n := make([]int, 2)
	for i := 0; i < 2; i++ {
		fmt.Scan(&n[i])
	}
	if n[0] == n[1] {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

Measured memory_bytes: 512
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
#define ALL(X) X.begin(), X.end()
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef std::pair<LL,LL> PLL;//
typedef std::pair<int,int> PII;//
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)1e18+20;
const LD PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

void solve(){
	int N;
	cin >> N;
	vector<int> A(N);
	for(int i=0;i<N;++i){
		cin >> A[i];
	}
	sort( A.begin(), A.end() );
	int pos = 0;
	int ans = 0;
	int res;
	vector<int>::iterator begin,end;
	begin = A.begin();
	end = A.end();
	while(pos<N){
		res = upper_bound(begin+pos, end, A[pos]) -begin;
		ans += (res-pos)&1;
		pos = res;
	}
	cout << ans << endl;
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <iomanip>
#include <stack>
#include <queue>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair <int, int> pii;

#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define pb push_back
#define ppb pop_back
#define mkp make_pair
#define F first
#define S second
#define show(a) cerr << #a <<" -> "<< a <<"\n"
#define fo(a, b, c, d) for(int (a) = (b); (a) <= (c); (a) += (d))
#define foo(a, b, c ,d) for(int (a) = (b); (a) >= (c); (a) -= (d))
//#define int ll

const int N = 2e5;
const int INF = 1e9;

int n;
string s;

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n;
	cin >> s;
//	cout << s.substr(0, n / 2) <<'\n'<< s.substr(n / 2, n / 2) <<'\n';
	if(n % 2 == 1 || (n % 2 == 0 && s.substr(0, n / 2) != s.substr(n / 2, n / 2))) {
		cout << "No\n";
	}	
	else {
		cout << "Yes\n";
	}
	return 0;
}
/*
	If you only do what you can do, 
	You will never be more than you are now!
	----------------------------------------
	We must all suffer from one of two pains: the pain of discipline or the pain of regret. 
	The difference is discipline weighs grams while regret weighs tons.
*/


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    double n,m,d;
    cin>>n>>m>>d;
    cout<<(d==0?n:2*(n-d))*(m-1)/(n*n)<<endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
const int INF=1e8;
int main()
{
    int n, m; cin>>n>>m;
    vector<int> g[100010];
    for(int i=0; i<m; i++){
        int u, v; cin>>u>>v; u--; v--;
        g[u].push_back(v);
    }
    int d[3][100010];
    for(int i=0; i<3; i++) fill(d[i], d[i]+n, INF);
    int s, t; cin>>s>>t; s--; t--;
    d[0][s]=0;
    deque<int> deq;
    deq.push_back(3*s);
    while(!deq.empty()){
        int p=deq.front();
        deq.pop_front();
        int x=p/3, k=p%3;
        int a=0;
        if(k==2) a=1;
        int l=(k+1)%3;
        for(auto y:g[x]){
            if(d[l][y]>d[k][x]+a){
                d[l][y]=d[k][x]+a;
                if(a) deq.push_back(l+y*3);
                else deq.push_front(l+y*3);
            }
        }
    }
    if(d[0][t]==INF) cout<<-1<<endl;
    else cout<<d[0][t]<<endl;
    return 0;
}

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

public class Main 

{ 
static int mod=(int)Math.pow(10, 9)+7;
	 static FastReader sc=new FastReader(); 
	 
		  public static void main(String[] args) 
    {
			  long a=i();
			  long b=i();
			  long c=i();
			  long d=i();
			  long A[]=new long[4];
			 A[0]=a*c;
			 A[1]=a*d;
			 A[2]=b*c;
			 A[3]=b*d;
			 long max=Long.MIN_VALUE;
			 for(long i : A) {
				 if(i>max)
					 max=i;
			 }
			 System.out.println(max);
			
			  
		  
    }
		  
		  
static int[] input(int n) {
	int A[]=new int[n];
	   for(int i=0;i<n;i++) {
		   A[i]=sc.nextInt();
	   }
	   return A;
   }
static long[] inputL(int n) {
	long A[]=new long[n];
	   for(int i=0;i<n;i++) {
		   A[i]=sc.nextLong();
	   }
	   return A;
   }
static String[] inputS(int n) {
	String A[]=new String[n];
	   for(int i=0;i<n;i++) {
		   A[i]=sc.next();
	   }
	   return A;
   }


static void input(int A[],int B[]) {
	   for(int i=0;i<A.length;i++) {
		   A[i]=sc.nextInt();
		   B[i]=sc.nextInt();
	   }
}
static long mod(long x) {
	  return ((x%mod + mod)%mod);
}

     static int i() {
    	 return sc.nextInt();
     }
     static String s() {
    	 return sc.next();
     }
     static long l() {
    	 return sc.nextLong();
     }  
     static void sort(int[] arr){
        int n = arr.length;
        Random rnd = new Random();
        for(int i=0; i<n; ++i){
            int tmp = arr[i];
            int randomPos = i + rnd.nextInt(n-i);
            arr[i] = arr[randomPos];
            arr[randomPos] = tmp;
        }
        Arrays.sort(arr);
     }
  
        
        
    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
} 





Measured memory_bytes: 25364
#require 'prime'
#require 'openssl'
MOD=10**9+7;  cnt=0; sum=0; prev=nil; can=true; h=Hash.new(0)
def gs() gets.chomp end
def gi() gets.chomp.to_i end
def gsmi() gets.chomp.split.map(&:to_f) end

def ar2(s1,s2,de=nil) Array.new(s1){Array.new(s2,de)} end
def ar3(s1,s2,s3,de=nil) Array.new(s1){Array.new(s2){Array.new(s3,de)}} end

def desc(ar) ar.sort!{|x,y| y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end
def sum(ar) ar.inject(:+).to_i end
def ceil(a,b) (a.to_f/b).ceil end

def C(a,b) b==0||a==b ? 1 : (b=a-b if a/2<b;(a-b+1..a).inject(:*)/(1..b).inject(:*)) end
def rui(ar) s=[0]; ar.size.times{|i| s<<s[-1]+ar[i]}; s end
def rev_rui(ar) s=[0]; ar.size.times.reverse_each{|i| s<<s[-1]+ar[i]}; s end

def puts_yesno(b) puts(b ? 'Yes' : 'No') end
def putsend(s) puts s; exit end
def pu(h) begin; require './../nemi_lib/debug.rb'; puts_val(h); rescue LoadError; end; end
########### ( ˘ω˘ )ｽﾔｧ… ###########
a,b=gets.chomp.split
aa=a.to_i
bb=(b.sub(/\./,"").gsub(/^[0]+/,"")).to_i
puts aa*bb/100

Measured memory_bytes: 14428
#include<bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (int)n; i++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007//1e9+7
typedef long long ll;
using namespace std;
int main()
{
  string a;
  ll k;
  cin >> a >> k;
  ll num1 = a[0] - '0';
  if(num1 == 1){
    ll count = 0;
    ll i = 0;
    while(true){
      if(a[i] == '1'){
	count ++;
	i ++;
      }else{
	break;
      }
    }
    if(count < k){
      cout << a[count] << endl;
    }else{
      cout << '1' << endl;
    }
  }else{
    cout << a[0] << endl;
  }
}


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

int cmp_func(const void* p, const void* q)
{
  return *((int *)p) - *((int *)q);
}


int main(void)
{
  int i, n;
  int alice = 0;
  int bob = 0;
  int a[1000];
  
  scanf("%d", &n);
  for (i = 0; i < n; i++)
    scanf("%d", &a[i]);
  qsort(a, n, sizeof(int), cmp_func);
  
  for (i = n - 1; i >= 0; i = i - 2) 
    alice += a[i];
  for (i = n - 2; i >= 0; i = i - 2)
    bob += a[i];
  
  printf("%d", alice - bob);
  return 0;
}

Measured memory_bytes: 128
# -*- coding: utf-8 -*-

[N, K] = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]

# 敵の体力を降順でソート
sorted_H = sorted(H, reverse=True)

# 最初のK体の敵は必殺技で倒す
new_H = sorted_H[K:]

print(sum(new_H))


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

int main()
{
    long long n;
    long long a, b;
    cin >> n >> a >> b;

    if (a + b == 0)
    {
        cout << '0' << endl;
        return 0;
    }
    long long k = n / (a + b);
    if (n % (a + b) == 0)
        cout << a * k << endl;
    else
    {
        if (n % (a + b) > a)
            cout << (a * k + a) << endl;
        else
        {
            cout << (a * k + n % (a + b)) << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 256
O = list(input())
E = list(input())
S = []
N1 = len(E)
N2 = len(O)
for i in range(N1):
    S.append(O[i])
    S.append(E[i])
if N1 < N2:
    S.append(O[-1])
print(''.join(S))

Measured memory_bytes: 3060