akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i,x) for(int i=0;i<x;i++)
#define put(ans)    cout << ans << endl;

int main(){
    int n;
    long long ans(0);
    cin >> n;

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

    put(ans);

    return 0;
}

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

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

    vector<uint64_t> A(N);
    for (uint64_t i = 0; i < N; i++)
    {
        cin >> A[i];
    }

    sort(A.begin(), A.end());
    
    uint64_t ans;
    ans = 0;
    for (uint64_t i = 1; i <= N - 1; i++)
    {
        ans = ans + A[(N - 1) - (i / 2)];
    }

    cout << ans << endl;
}

Measured memory_bytes: 4828
n, k = map(int, input().split())
ll = []
for i in range(n):
    a, b = map(int, input().split())
    ll.append([a, b])
lls = sorted(ll)
cnt = 0
for i in range(n):
    cnt += lls[i][1]
    if cnt  >= k:
        print(lls[i][0])
        break

Measured memory_bytes: 20872
#include <bits/stdc++.h>
#define ll long long
#define vl vector<ll int>
#define vs vector<string>
#define v vector<int>

using namespace std;

int main(){
	int x;
	cin>>x;
	if(x>=30){
		cout<<"Yes" <<endl;
		}
		else{
			cout<<"No" <<endl;
			}
}	


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define sz(x) int(x.size())
#define pb push_back
using ll=long long;
const ll MOD=1000000007,MOD2=998244353,INF=9223372036854775807;//INFはllの最大値で19桁

//nのp乗
ll power(ll n,ll p){
    if(p==0){return 1;}
    if(p%2==1){return n*power(n,(p-1)/2)%MOD*power(n,(p-1)/2)%MOD;}
    else{return power(n,p/2)*power(n,p/2)%MOD;}
}

int main() {
    ll N,K;
    cin>>N>>K;
    vector<ll> num(K+1);
    rep(i,K+1){
        if(i==0)continue;
        num.at(i)=power(K/i,N);
    }
    for(ll i=K;i>0;i--){
        for(ll j=2;i*j<=K;j++){
            num.at(i)-=num.at(i*j);
            num.at(i)%=MOD;
        }
    }
    ll ans=0;
    rep(i,K+1){
        ans+=i*num.at(i)%MOD;
        ans%=MOD;
    }
    ans+=MOD;
    ans%=MOD;
    cout<<ans<<endl;
    //rep(i,K+1){cout<<num.at(i)<<" ";}
}


Measured memory_bytes: 3944
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K
#define INF 1e18
#define MOD 100000007
#define SIZE 10005
#define PI 	3.14159265358979323846


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b;
    cin >> a >> b;
    cout << ((a%500<=b)?"Yes":"No") << endl;
}

Measured memory_bytes: 256
n, a, b = map(int, input().split())
mod = 10**9+7
ans = pow(2, n, mod)-1

nCa = 1
nCb = 1
for i in range(b):
    nCb *= (n-i)
    nCb %= mod
    nCb *= pow(i+1, mod-2, mod)
    if i == a-1:
        nCa = nCb
ans -= nCa
ans %= mod
ans -= nCb
ans %= mod

print(ans)

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

namespace ABC162C
{
    class Program
    {
        static void Main(string[] args)
        {
            long K = long.Parse(Console.ReadLine());
            long ans = 0;
            for (long a = 1; a <= K; a++)
            {
                for (long b = 1; b <= K; b++)
                {
                    for (long c = 1; c <= K; c++)
                    {
                        ans += gcd(gcd(a, b), c);
                    }
                }
            }
            Console.WriteLine(ans);
        }
        static long gcd(long a, long b)
        {
            while (a > b)
            {
                a -= b;
            }
            long temp = a;
            a = b;
            b = temp;
            if (a == b)
            {
                return (a);
            }
            else
            {
                return (gcd(a, b));
            }
        }
    }
}


Measured memory_bytes: 27524
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <math.h>

using namespace std;

#define MAX 100000

struct TRAMP{
    char mark;
    int number,inputed_order;
};

TRAMP cards[MAX];

int n;

int Partition(int left,int right){
    int i = left-1,pivot = cards[right].number;
    for(int start = left; start < right; start++){
        if(cards[start].number <= pivot){
                i++;
                std::swap(cards[i],cards[start]);
        }
    }

    std::swap(cards[i+1],cards[right]);

    return i+1;
}

void quickSort(int left,int right){
    if(left < right){
        int q = Partition(left,right);
        quickSort(left,q-1);
        quickSort(q+1,right);
    }
}


int main(){

    bool stableFLG = true;
    scanf("%d",&n);

    for(int i = 0; i < n; i++){
        scanf("%s %d",&cards[i].mark,&cards[i].number);
        cards[i].inputed_order = i;
    }

    quickSort(0,n-1);

    for(int i = 1; i < n; i++){
        if(cards[i].number == cards[i-1].number && cards[i].inputed_order < cards[i-1].inputed_order){
        	stableFLG = false;
        	break;
        }
    }

    if(stableFLG){
        printf("Stable\n");
    }else{
        printf("Not stable\n");
    }

    for(int i = 0; i < n; i++)   printf("%c %d\n",cards[i].mark,cards[i].number);
}

Measured memory_bytes: 4332
#include<iostream>
#include<vector>
#include<string>

int main(){
    std::string S, T;
    std::cin >> S >> T;
    int cnt = 0;
    for(int i = 0; i < S.size(); i++){
        if(S[i] != T[i]) cnt++;
    }
    std::cout << cnt << std::endl;
    return 0;
}


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

int main() {
    cin.tie(0)->sync_with_stdio(false);

	int n, m; cin >> n >> m;
	map<int, int> ab;
	REP(i, m) {
		int a, b; cin >> a >> b;
		ab[a]++;
		ab[b]++;
	}
	bool ok = true;
	for (auto x : ab)
		if (x.second % 2)
			ok = false;
	cout << ((ok == true) ? "YES" : "NO") << '\n';
    return 0;
}


Measured memory_bytes: 7712
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;
using ll = long long;
//----------------------------------------------
#define rep(i,m,n) for(int i=m;i<(int)(n);i++)
#define putout(x) cout<<x<<endl
//----------------------------------------------



int main()//
{
	int num[3];

	rep(i, 0, 3)
	{
		cin >> num[i];
	}

	if (num[1] / num[0] >= num[2])
	{
		putout(num[2]);
	}
	else
	{
		putout(num[1] / num[0]);
	}

	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;

template <class T> void vecout(T V) {
    auto t = V.begin();
    while(t != V.end()) {
        cout << *t++;
        if(t != V.end())
            cout << " ";
    }
    cout << endl;
};

int main() {
    int n, q, tmp, C = 0;
    cin >> n;
    map<int, bool> S;
    rep(i, n) {
        cin >> tmp;
        S.insert(make_pair(tmp, 1));
    }
    cin >> q;
    rep(i, q) {
        cin >> tmp;
        if(S.count(tmp))
            C++;
    }
    cout << C << endl;
}


Measured memory_bytes: 3124
i,j,o;main(r,n,s){for(;scanf("%d%d",&n,&s),n+s;printf("%d\n",r))for(r=i=0;i<1024;i++)if(__builtin_popcount(i)==n){for(j=o=0;j<10;j++)o+=(1<<j)&i?j:0;o-s||r++;}}

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

class UF{
  vi p,r;

public:
  UF(int n):p(n,-1),r(n,0){ }

  int find(int x){ return (p[x]<0)?x:(p[x] = find(p[x])); }

  void unite(int x,int y){
    x = find(x); y = find(y);
    if(x==y)return;

    if(r[x] < r[y])p[x] = y;
    else p[y] = x;
    if(r[x] == r[y])r[x]++;
  }

  bool same(int x,int y){return find(x)==find(y);}
};

int memo[1001][1001][2];

int rec(int odd, int even, int edges){
  if(memo[odd][even][edges]>=0)return memo[odd][even][edges];
  if(odd + even == 2)return edges;

  int res = 1;
  if(edges)res *= rec(odd, even, 1-edges);
  if(odd && even)res *= rec(odd, even-1, 1-edges);
  if(odd >= 2)res *= rec(odd-2, even+1, edges);
  if(even >= 2)res *= rec(odd, even-1, 1-edges);

  return memo[odd][even][edges] = 1-res;
}

int main(){
  int n;
  cin >> n;
  UF uf(n);

  string s[1010];
  int num = 0;
  rep(i,n){
    cin >> s[i];
    rep(j,i)if(s[i][j] == 'Y')uf.unite(i,j), num--;
  }

  vi card(n,0);
  rep(i,n)card[uf.find(i)]++;
  
  int odd = 0, even = 0;
  rep(i,n){
    if(card[i]){
      if(card[i] & 1)odd++;
      else even++;
      num += card[i]*(card[i]-1)/2;
    }
  }

  memset(memo,-1,sizeof(memo));
  if(rec(odd, even, num&1))cout << "Taro" << endl;
  else cout << "Hanako" << endl;
}

Measured memory_bytes: 10212
S = input()
count=0
if len(S)%2==0:
  for i,s in enumerate(S):
    if S[len(S)-i-1]!=s:
      count+=1
    if i>=len(S)//2-1:
      break
else:
  for i,s in enumerate(S):
    if S[len(S)-i-1]!=s:
      count+=1
    if i==len(S)//2:
      break
print(count)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <unordered_map>
#include <stdio.h>
#include <list>
#include <vector>
#include <algorithm>
#include <stack>
#include <climits>
#include <cmath>
#include <map>
#include <queue>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; ++i)
#define ALL(v) v.begin(), v.end()
typedef long long ll;


vector<int> IntegerTovector(int bit,int N)
{
	vector<int> S;
	for(int i = 0;i < N; ++i)
	{
		if(bit &(1 << i))
		{
			S.push_back(1);
		}
		else
		{
			S.push_back(0);
		}
	}
	return S;
}

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

	int n = s.size();
	ll ans = 0;

	for(int bit = 0;bit<(1<<(n-1));++bit )
	{
		vector<int> aaa = IntegerTovector(bit,n-1);
		//cout<<' ';rep(i,n-1)cout<<aaa[i];cout<<endl;
		ll now = 0;
		for(int i=0;i<n-1;i++)
		{
			now += s[i]-'0';
			if(aaa[i]==0)
			{
				now*=10;
			}
			else
			{
				//cout<<now<<endl;
				ans+=now;
				now=0;
			}
			
		}
		now += s.back()-'0';
		//cout<<now<<endl;
			ans+=now;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
var input = '';
var readable = process.stdin;
readable.resume();
readable.setEncoding( 'utf-8' );
readable.on( 'data', function( chunk ) {
  input += chunk;
});

readable.on( 'end', function() {
  var data = input.split( '\n' );
  var output = [];
  for( var i=0; i<data.length; i++ ) {
    var xy = data[i].split( ' ' );
    if( "0 0" == data[i] ) { break; }
    
    if( parseInt( xy[1] ) < parseInt( xy[0] ) ) {  
      output.push( xy[1]+' '+xy[0] );
    } else {
      output.push( data[i] );      
    }
  }
  console.log( output.join( '\n' )  );
});

Measured memory_bytes: 9836
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;
using System.Threading.Tasks;



class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }
    

    Scanner cin;

    void calc()
    {
        cin = new Scanner();
        int N = cin.nextInt();
        int K = cin.nextInt();

        if(K == 0)
        {
            Console.WriteLine((long)N * N);
            return;
        }

        long ans = 0;
        for (int b = K + 1; b <= N; b++)
        {
            ans += (long)(N / b) * (b - K);
            ans += Math.Max(0, (N % b) - (K - 1));
        }
        Console.WriteLine(ans);
    }

    //swap
    void swap<T>(ref T a, ref T b)
    {
        T c = a;
        a = b;
        b = c;
    } 

}




class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

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

    public long nextLong()
    {
        return long.Parse(next());
    }

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

    public double nextDouble()
    {
        return double.Parse(next());
    }


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



Measured memory_bytes: 13140
#include<bits/stdc++.h>
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define pii pair<int,int>
#define fi first
#define se second
#define PB push_back
using namespace std;
int n;
int main(){
	scanf("%d",&n);
	if ((n&(-n))==n) return puts("No"),0;
	puts("Yes");
	printf("1 2\n2 3\n3 %d\n%d %d\n%d %d\n",n+1,n+1,n+2,n+2,n+3);
	for (int j=4;j+1<=n;j+=2) printf("%d %d\n%d %d\n%d %d\n%d %d\n",j,j+1,j+1,n+1,n+1,n+j,n+j,n+j+1);
	if (n%2==0){
		int id1=1;
		for (;id1*2<=n;id1*=2);
		printf("%d %d\n%d %d\n",n,n+id1,n+1-id1,n+n);
	}
}
/*
46
57
1-2-3-1-2-3
  46
  57
*/

Measured memory_bytes: 2816
#include <bits/stdc++.h>
using namespace std;
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;
}
typedef long long int ll;

#define EPS (1e-7)
#define INF (1 << 30)
#define LLINF (1LL << 60)
#define PI (acos(-1))
#define MOD (1000000007)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------
vector<vector<int>> g(10001);
vector<bool> seen(10001, false);
vector<int> ans;

void dfs(int v)
{
    if (seen[v])
    {
        return;
    }
    seen[v] = true;
    for (auto next : g[v])
    {
        dfs(next);
    }
    ans.push_back(v);
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int V, E;
    cin >> V >> E;
    for (int i = 0; i < E; i++)
    {
        int s, t;
        cin >> s >> t;
        g[s].push_back(t);
    }
    for (int i = 0; i < V; i++)
    {
        dfs(i);
    }
    reverse(ALL(ans));
    for (auto a : ans)
    {
        cout << a << endl;
    }
}


Measured memory_bytes: 3812
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <climits>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
//typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define revrep(i, n) for(ll i = (n)-1; i >= 0; i--)
#define pb push_back
#define f first
#define s second
#define chmin(x, y) x = min(x, y);
#define chmax(x, y) x = max(x, y);
/*
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
ll max3(ll a, ll b, ll c){return max(a, max(b, c));};
ll min3(ll a, ll b, ll c){return min(a, min(b, c));};
ll max4(ll a, ll b, ll c, ll d){return max(max(a, b), min(c, d));};
ll min4(ll a, ll b, ll c, ll d){return min(min(a, b), min(c, d));};
ll max5(ll a, ll b, ll c, ll d, ll e){return max(max(a, b), max3(c, d, e));};
ll min5(ll a, ll b, ll c, ll d, ll e){return min(min(a, b), min3(c, d, e));};
*/
//const ll INFL = LLONG_MAX;//10^18 = 2^60
const ll INFL = 1LL<<60;
//const int INF = INT_MAX;
const int INF = 1 << 30;//10^9
ll MOD = 1000000007;
//ll MOD = 998244353;

vector<ll> dy = {0, 1, 0, -1, 1, 1, -1, -1, 0};
vector<ll> dx = {1, 0, -1, 0, 1, -1, 1, -1, 0};

void pres(double A, ll x = 10){cout << fixed << setprecision(x) << A << endl;}
void BinarySay(ll x, ll y = 60){rep(i, y) cout << (x>>(y-1-i) & 1); cout << endl;}
ll cnt_bit(ll x){return __builtin_popcountll(x);}

ll pow_long(ll x, ll k){
  ll res = 1;
  while(k > 0){
    if(k % 2) res *= x;
    x *= x; k /= 2;
  }
  return res;
}

ll pow_mod(ll x, ll k){
  ll res = 1;
  while(k > 0){
    if(k % 2){
      res *= x; res %= MOD;
    }
    x *= x; x %= MOD;
    k /= 2;
  }
  return res;
}

ll inverse(ll x){return pow_mod(x, MOD - 2);};

ll gcd(ll a, ll b){
    if(b == 0) return a;
    return gcd(b, a % b);
}

ll lcm(ll x, ll y){return x / gcd(x, y) * y;};


void solve(){
  ll N;
  cin >> N;
  if(N & 1){
    cout << 0 << endl;
    return;
  }
  N /= 2;
  ll cnt = 0;
  ll now = 5;
  while(true){
    cnt += N / now;
    if(N / now == 0) break; 
    now *= 5;
  }
  cout << cnt << endl;
}


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


Measured memory_bytes: 256
#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin


def main():
    n, q = (int(s) for s in stdin.readline().split())
    s = [{i} for i in range(n)]

    for _ in range(q):
        com, x, y = (int(s) for s in stdin.readline().split())
        if com:
            if x in s[x] and y in s[x]:
                print(1)
            else:
                print(0)
        else:
            a = s[x]
            b = s[y]
            if a is not b:
                a |= b
                for i in a:
                    s[i] = a


main()

Measured memory_bytes: 11068
#include<cstdio>
#include<cstring>
#include<algorithm>
#define rep(i,a,b) for(i=a;i<=b;i++)
using namespace std;
typedef long long ll;
const int mod=998244353;
const int lim=20,maxn=(1<<20)+5,N=110;
int F[lim+1][maxn],G[lim+1][maxn];
int dp[10][N];int g[N][N];
int a[N];char s[N];
ll p[N],c[N][N];
int n;

void work(int K){
	int i,j,k;int cur,x;
	rep(i,0,(1<<K)-1){
		rep(j,1,K/2)	if(K%j==0){
			x=i;cur=p[j];rep(k,1,K/j)	cur&=x,x>>=j;		
			G[K][i]=(G[K][i]+F[j][cur])%mod;
		}
		//F[K][i]=(F[K][i]+1ll*F[K-1][i>>1]*((i&1)+1))%mod;
		rep(j,1,K)	if(G[j][i&p[j]])	F[K][i]=(F[K][i]+1ll*G[j][i&p[j]]*F[K-j][i>>j])%mod;
	}
}	

void init(){
	int i;
	rep(i,1,50)	p[i]=(1ll<<i)-1;
	F[0][0]=1;
	G[1][0]=F[1][0]=1;F[1][1]=G[1][1]=2;
	rep(i,2,lim)	work(i);
}

int solve(int K,ll w,int d){
	if(K<=lim)	return F[K][w];
	int i,j,k;ll cur;int x;int opt;
	//memset(dp[d],0,(K+1)*sizeof(int));
	rep(i,0,K)	dp[d][i]=0;
	dp[d][0]=1;
	rep(i,0,K-1) if(dp[d][i]){
		if(K-i<=lim){dp[d][K]=(dp[d][K]+1ll*dp[d][i]*F[K-i][w>>i])%mod;continue;}
		opt=(w>>i)&1;
		dp[d][i+1]=(dp[d][i+1]+1ll*dp[d][i]*(opt+1))%mod;
		rep(j,1,(K-i)>>1){		
			for(cur=(w&p[i+j])>>i,x=i+j,k=2;k<=(K-i)/j;k++){
				cur&=(w&p[x+j])>>x;x+=j;
				dp[d][x]=(dp[d][x]+1ll*dp[d][i]*solve(j,cur,d+1))%mod;
			}
		}
	}
	return dp[d][K];
}

int getG(int l,int r){
	if(r-l+1<=lim)	return G[r-l+1][c[l][r]];
	int len=r-l+1;int ret=0;int i;
	ll cur;int x;
	rep(i,1,len/2)	if(len%i==0){
		for(cur=p[i],x=l;x<=r;x+=i)	cur&=c[x][x+i-1];
		ret=(ret+solve(i,cur,1))%mod;
	}
	return ret;
}		

int main(){
	//freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
	int i,j;
	init();
	scanf("%s",s+1);n=strlen(s+1);
	rep(i,1,n)	a[i]=s[i]-'0';
	for(i=n;i;i--)	rep(j,i,n)	c[i][j]=(c[i+1][j]<<1)+(a[i]&1);
	rep(i,1,n)	rep(j,i,n)	g[i][j]=getG(i,j);
	dp[0][0]=1;
	rep(i,0,n-1) rep(j,i+1,n) dp[0][j]=(dp[0][j]+1ll*dp[0][i]*g[i+1][j])%mod;
	printf("%d\n",dp[0][n]);
}
			
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	

Measured memory_bytes: 92672
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>

using namespace std;


int main() {
    int N, K;
    cin >> N >> K;
    string human;
    cin >> human;

    human += '0';
    vector<int> left(N + 1), right(N + 1);
    int katamari = 0;
    for (int i = 0; i < N; i++) {

        if (i >= 1 && human[i - 1] == '0' && human[i] == '1')
            left[katamari] = i;
        if (human[i] == '1' && human[i + 1] == '0') {
            right[katamari] = i;
            katamari++;
        }

    }
    if (K == 0) {
        int ans = 0;
        for (int i = 0; i < katamari; i++)
            ans = max(ans, right[i] - left[i]);
        cout << ans + 1 << endl;
    }
    else {
        if (human[0] == '1' && K >= katamari) {
            cout << N << endl;
        }
        else if (K - 1 >= katamari)
            cout << N << endl;
        else {
            int ans = right[K - 1];
            for (int i = 0; i + K < katamari; i++) {
                ans = max(ans, right[i + K] - left[i]);
            }
            if (human[N - 1] == '0')
                ans = max(ans, (N - 1) - left[katamari - K]);
            cout << ans + 1 << endl;
        }
    }
}


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

#include <numeric>
#include <iterator>

using namespace std;
#define TIMES(var, N) for (int var = 0; var < N; ++var)

#ifdef TEST
#define DEBUG(stmts) \
    do               \
    {                \
        stmts;       \
    } while (0)
#else
#define DEBUG(_)
#endif

int solve(const string &str)
{
    if (str.size() == 1)
    {
        return 0;
    }
    vector<int> m(str.size());
    for (int n = 1; n < str.size(); ++n)
    {
        auto pre = str.substr(0, n);
        auto post = str.substr(n);
        m.push_back(stoi(pre) * stoi(post));
    }
    return 1 + solve(to_string(*max_element(m.begin(), m.end())));
}

int main()
{
    int Q;
    cin >> Q;
    TIMES(_, Q)
    {
        string str;
        cin >> str;
        cout << solve(str) << endl;
    }

    return 0;
}



Measured memory_bytes: 3284
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio> 
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rangeRep(i, n, m) for(int (i) = (n); (i) < (m); (i)++)

int canGo[100001] = {0};

class Solve {
public:
	Solve() {};
	~Solve() {};

	void solver() {
		int ans = 0;
		int n;
		std::cin >> n;
		std::vector<std::pair<int, int>> friends(n, std::make_pair(0, 0));
		rep(i, n) {
			std::cin >> friends[i].first >> friends[i].second;
			//Exclude myself
			friends[i].first--; friends[i].second--;
		}
		//Record the number of people who can go.
		for (auto& x : friends) {
			rangeRep(i, x.first, x.second+1) {
				canGo[i]++;
			}
		}
		int max = 0;
		rep(i, n+1) {
			if (canGo[i] >= i) {
				max = i;
			}
		}
		std::cout << max << std::endl;
	}
private:

};

int main() {
	Solve solve;
	solve.solver();
	return 0;
}

Measured memory_bytes: 3816
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using namespace std;
using ll = long long;
using P = pair<int, int>;

int A[201][201];
int d[10][10];

int main(){
    int h, w;
    cin >> h >> w;

    rep(i, 10){
        rep(j, 10) cin >> d[i][j];
    }

    rep(i, h){
        rep(j, w) cin >> A[i][j];
    }

    int n = 10;
    rep(k, n){
        rep(i, n){
            rep(j, n){
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }

    int ans = 0;
    rep(i, h){
        rep(j, w){
            if(A[i][j] != -1) ans += d[A[i][j]][1];
        }
    }

    cout << ans << endl;
}

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

namespace CSharpSample01
{
	class Program
	{

		static void Main(string[] args)
		{
			var valueList = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
			var X = valueList[0];
			var Y = valueList[1];
			var flag = false;
			for(int i = 0;i <= X; i++)
			{
				var answer = (2 * i) + (4 * (X - i));
				if (Y == answer){
					flag = true;
					break;
				}
			}

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

		}
	}
}

Measured memory_bytes: 28220
#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <atcoder/all>

using ll = long long int;
const int INF = (1<<25);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

int n,m,dx[4]={-1,0,0,1},dy[4]={0,-1,1,0};

std::string s[111];

bool check(int i, int j){
	return (0<=i&&i<n&&0<=j&&j<m&&s[i][j]=='.');
}

int main(void){
	int i,j,k,x,y;
	std::cin >> n >> m;
	atcoder::mf_graph<int> g(n*m+2);
	for(i=0; i<n; ++i){
		std::cin >> s[i];
	}
	for(i=0; i<n; ++i){
		for(j=0; j<m; ++j){
			if(!check(i,j)){
				continue;
			}
			if((i+j)%2){
				g.add_edge(i*m+j,n*m+1,1);
				continue;
			}
			g.add_edge(n*m,i*m+j,1);
			for(k=0; k<4; ++k){
				if(check(i+dx[k],j+dy[k])){
					g.add_edge(i*m+j,(i+dx[k])*m+(j+dy[k]),1);
				}
			}
		}
	}
	std::cout << g.flow(n*m,n*m+1) << std::endl;
	auto v = g.edges();
	for(auto e: v){
		if(e.from == n*m){
			continue;
		}
		if(e.to == n*m+1){
			continue;
		}
		if(!e.flow){
			continue;
		}
		i = e.from/m; j = e.from%m;
		x = e.to/m; y = e.to%m;
		if(i>x){
			s[x][y] = 'v';
			s[i][j] = '^';
		}else if(i<x){
			s[i][j] = 'v';
			s[x][y] = '^';
		}else if(j>y){
			s[x][y] = '>';
			s[i][j] = '<';
		}else{
			s[i][j] = '>';
			s[x][y] = '<';
		}
	}
	for(i=0; i<n; ++i){
		std::cout << s[i] << std::endl;
	}
	return 0;
}


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

int main() {
    int n, m;cin>>n;
    unordered_map<int,int> d,t;
    for(int i=0;i<n;i++) {
        int x;cin>>x;
        d[x]++;
    }
    cin>>m;
    for(int i=0;i<m;i++) {
        int x;cin>>x;
        t[x]++;
    }
    for(auto &i:t) {
        if(d[i.first] < i.second) {
            cout<<"NO\n";return 0;
        }
    }
    cout<<"YES\n"; return 0;
}

Measured memory_bytes: 19704
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort()
count = 0
for i in range(0, n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            a = l_list[i]
            b = l_list[j]
            c = l_list[k]
            if a == b or b == c or c == b:
                continue
            if a + b > c:
                count += 1
            else:
                break
print(count)


Measured memory_bytes: 9196
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	
	static int []d;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		
		d = new int [n];
		
		for(int i = 0;i < n ; i++) {
			d[i] = sc.nextInt();
		}
		Arrays.sort(d);
		
		int cnt = 0;
		
		for(int i = 0; i < n; i++) {
			for(int j = i+1 ; j < n ; j++) {
				cnt += binary_search(d[i] + d[j]) - j - 1;
			}
		}
		
		System.out.println(cnt);
	}
	
	static int binary_search(int key) {
		int left = -1;
		int right = d.length;
		
		while(right - left > 1) {
			int mid = left + (right - left)/2;
			
			if(jdg(mid , key)) {
				right = mid;
			}
			else {
				left = mid;
			}
		}
		return right;
	}
	
	static boolean jdg(int index ,int key ) {
		if(d[index] >= key)
			return true;
		else
			return false;
		
	}
}

Measured memory_bytes: 26792
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define pb push_back
#define mp make_pair
#define M 1000000007
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
const int N = 1e5 + 5;
int n , dp[N][3];
int main(){
	scanf("%d",&n);
	for (int i = 1,a[3]; i <= n; ++i){
		scanf("%d%d%d",&a[0],&a[1],&a[2]);
		for (int now = 0; now < 3; ++now)dp[i][now] = max(dp[i-1][(now+1)%3],dp[i-1][(now+2)%3]) + a[now];
	}
	printf("%d\n",max({dp[n][0] , dp[n][1] , dp[n][2]}));

}	

Measured memory_bytes: 4948
N, K = map(int, input().split())
A = list(map(int, input().split()))
visited = [False for _ in range(N)]

i = 1
c = 0
jun = []

if K <= N:
    while True:
        K -= 1
        i = A[i-1]
        if K == 0:
            print(i)
            exit()


while True:
    if i == A[i-1]:
        print(i)
        exit()
    if visited[i-1]:
        lp = i
        break
    else:
        visited[i - 1] = True
        jun.append(i)
        i = A[i-1]
        c += 1
ji = jun.index(lp)
K -= len(jun[:ji])
jun = jun[ji:]

kai = K % len(jun)
if kai == len(jun):
    print(jun[0])
else:
    print(jun[kai])

Measured memory_bytes: 112536
#include <iostream>
#include <iomanip>
#include <vector>
#include <valarray>
#include <map>
#include <set>
#include <list>
#include <queue>
#include <stack>
#include <bitset>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <complex>
#include <string>
#include <sstream>

#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cmath>

using namespace std;

#define all(c) c.begin(),c.end()
#define repeat(i,n) for(int i=0;i<static_cast<int>(n);i++)
#define debug(x) #x << "=" << (x)
#define dump(x) cerr << debug(x) << " (L:" << __LINE__ << ")"<< endl

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<string> vs;

template<typename T>
ostream& operator<<(ostream& os, const vector<T>& vec){
    os << "[";
    for(int i = 0; i < vec.size(); i++){
        os << vec[i] << ",";
    }
    os << "]";
    return os;
}

template<typename T>
T input(){
    T t;
    cin >> t;
    return t;
}

template<typename T>
vector<T> input(const int N){
    vector<T> v(N);
    repeat(i,N) cin >> v[i];
    return v;
}

long long gcd(long long a, long long b){
    if(b == 0){
        return a;
    }
    return gcd(b, a % b);
}

long long lcm(long long a, long long b){
    return (a / gcd(a, b)) * b;
}

long long mul(const long long& a, const long long& b, const long long& mod) {
    return ((a % mod) * (b % mod)) % mod;
}

long long power(const long long& x, const long long& y, const long long& mod) {
    if (y == 0) {
        return 1;
    } else if (y == 1) {
        return x % mod;
    } else {
        long long value = power(x, y / 2, mod);
        if (y % 2 == 0) {
            return mul(value, value, mod);
        } else {
            return mul(value, value, mod) * x % mod;
        }
    }
}

long long div(const long long& a, const long long& b, const long long& mod) {
    return mul(a, power(b, mod - 2, mod), mod);
}

map<long long, long long> factorials;
long long factorial(const long long& n, const long long& mod) {
    if (n == 0 || n == 1) {
        return 1;
    }
    if (factorials[n] != 0) {
        return factorials[n];
    }
    factorials[n] = n * factorial(n - 1, mod) % mod;
    return factorials[n] % mod;
}

long long combination(const long long& n, const long long& x, const long long& mod) {
    long long numerator = 1;
    long long denominator = 1;
    repeat(i, x) {
        numerator *= (n - i) % mod;
        numerator %= mod;
        denominator *= (i + 1) % mod;
        denominator %= mod;
    }
    return div(numerator, denominator, mod);
}

bool hasOddNumber(vi& numbers) {
    repeat (i, numbers.size()) {
        if (numbers[i] % 2 != 0) {
            return true;
        }
    }
    return false;
}

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

    vi numbers = input<int>(N);

    int count = 0;
    while (!hasOddNumber(numbers)) {
        count++;
        repeat (i, numbers.size()) {
            numbers[i] >>= 1;
        }
    }
    cout << count << endl;
    return 0;
}


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

int main()
{
    int n;
    cin >> n;
    int h[n];
    for (int i = 0; i < n; i++)
    {
        cin >> h[i];
    }
    int ans = 0;
    bool isend = false;
    while (isend == false)
    {
        isend = true;
        for (int i = 0; i < n; i++)
        {
            if (h[i] > 0)
            {
                ans++;
                isend = false;
                for (int j = i; j < n; j++)
                {
                    if (h[j] == 0)
                        break;
                    h[j]--;
                }
                break;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

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

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x){
  while(x->left != NIL){
    x = x->left;
  }
  return x;
}

Node treeSearch(Node u, int k){
  if (u == NIL || k == u->key){
    return u;
  }
  if (k < u->key){
    return treeSearch(u->left, k);
  } else {
    return treeSearch(u->right, k);
  }
}

Node treeSuccessor(Node x){
  Node y;
  if (x->right != NIL){
    return treeMinimum(x->right);
  }
  y = x->parent;
  while (y != NIL && x == y->right){
    x = y;
    y = y->parent;
  }
  return y;

}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y



}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while (x!=NIL){
    y = x;
    if (z->key < x->key){
      x = x->left;
    } else {
      x = x->right;
    }
  }
  z->parent = y;
  if (y == NIL){
    root = z;
  } else if (z->key < y->key){
    y->left = z;
  } else {
    y->right = z;
  }

}

void inorder(Node u){
  if (u!=NIL){
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
  }
}
void preorder(Node u){
  if (u!=NIL){
    printf(" %d",u->key);
    preorder(u->left);
    preorder(u->right);
  }
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}

Measured memory_bytes: 24040
using System;
using System.Linq;

class prog{
  static void Main(){
    Console.ReadLine();
    int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
    
    int ans = 0;
    for(int i = 0; i < a.Length; i++){
      while (a[i] % 2 == 0) {
        ans++;
        a[i] /= 2;
      }
    }
    
    Console.WriteLine(ans);
  }
}

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

int main()
{
	long long int A,B,K;
  	cin>>A>>B>>K;
  	if(K<=A)
      cout<<A-K<<" "<<B;
  	else
    {
      if(K-A>B)
        cout<<"0"<<" "<<"0";
      else
        cout<<"0"<<" "<<B-K+A;
    }
  
	return 0;

}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using P   = pair<ll, ll>;
using mat = vector<vector<ll>>;

void IOS() { ios::sync_with_stdio(false), cin.tie(0); }

const ll INF = 1e16;
const ll MOD = 998244353;
const ld EPS = 1e-12;

template <typename T>
void dump(T x) { cout << x << endl; }
void dumpf(ld x, int t) { cout << setprecision(t) << fixed << x << endl; }
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
	fill((T *)array, (T *)(array + N), val);
}
inline ll mod(ll a, ll b) {
	if (a > 0) return a % b;
	if (a % b == 0) return 0;
	ll x = -a / b + 1;
	a += x * b;
	return a % b;
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

// ll dx[4] = {1, 0, -1, 0};
// ll dy[4] = {0, 1, 0, -1};

ll dp[302][302 * 302] = {};

ll MAXS = 302 * 302;

int main() {
	IOS();
	ll n, k;
	string s;
	cin >> n >> s >> k;
	char x = s[k - 1];
	for (int i = 0; i < n; i++) {
		if (s[i] != x) s[i] = '*';
	}
	dump(s);
}

Measured memory_bytes: 256
#include <stdio.h>
 
int main(){
    int a;
    scanf("%d",&a);
    if(a==1 || a==10 || a==100) puts("1");
    else if(a==11 || a== 101 || a== 110) puts("2");
    else if(a==111) puts("3");
    else puts("0");
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define LL long long
LL A,B;
LL gcd(LL A,LL B)
{
	return B?gcd(B,A%B):A;
}
LL lcm(LL A,LL B)
{
	return A*B/gcd(A,B);
}
int main()
{
	scanf("%lld%lld",&A,&B);
	cout<<lcm(A,B);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (size_t i = a; i < b; i++)
#define REP(i,b) FOR(i,0,b)
#define RFOR(i,a,b) for (size_t i = a-1; i >= b; i--)
#define RREP(i,a) RFOR(i,a,0)
#define INF 1e7


int main()
{
  int n, ans = 0;
  cin>>n;

  REP(i,n+1) ans += i;

  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll GCD(ll x,ll y){
    if(y == 0) return x;
    else return GCD(y,x%y);
}

ll LCM(ll a,ll b){
    return a / GCD(a,b) * b;
}

const int MOD = 1000000007;

int main() {
    int n; cin >> n; int a[n];
    for(int i = 0; i < n;i++){
        cin >> a[i];
    }
    int i = 0;
    ll ans = 0;
    while(true){
        if(i > n) break;
        int cnt = 0;
        if(a[i] == i+1){
            while(a[i] == i+1){
                cnt++;
                i++;
            }
            if(cnt == 1){
                ans += 1;
            }else{
                ans += (cnt+(2-1))/2;
            }
        }
        i++;
    }
    cout << ans;
}



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

int N, K, senbey[111];

int main(){
    using namespace std;
    cin >> N >> K;
    
    for(int i = 0, j = 0; i < N; ++i){ // N 枚のせんべいを配る
        senbey[j]++; // 配る
        ++j;
        if(j >= K)j = 0; // 最後の人になったら最初に戻る
    }
    
    cout << senbey[0] - senbey[K - 1] << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define endl '\n'o
using namespace std;
const int MOD = 1000000007, MAX = 2000000007, MAXN = 100005;

void solve(int n)
{
    
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	double w,h,x,y;
    cin>>w>>h>>x>>y;
    cout<<fixed;
    if(2*x == w && 2*y == h)
    {
        cout<<(w*h)/2<<' '<<1;
    }
    else
    {
        cout<<(w*h)/2<<' '<<0;
    }
    
	return 0;
}

Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    w=list(input())
    w.sort()
    if len(w)%2!=0:
        ans='No'
    else:
        ans='Yes'
        for i in range(0,len(w)-1,2):
            if w[i]!=w[i+1]:
                ans='No'
    print(ans)
resolve()

Measured memory_bytes: 3060
#include <cstdio>
#include <algorithm>

using namespace std;


/* -----------------------------------------------------------------------------
	型とクラス定義
----------------------------------------------------------------------------- */

/* -----------------------------------------------------------------------------
	大域データ
----------------------------------------------------------------------------- */
int A;	// 窓の横方向の長さ
int B;	// カーテンの横方向の長さ

int main () {

	// 個数と長さの読込み
	scanf("%d %d", &A, &B);

	printf("%d\n", std::max(0, A - 2 * B));

	return 0;
}

Measured memory_bytes: 128
#include<stdio.h>
int main(void)
{
    int a,b;
    scanf("%d %d", &a, &b);
    if(a<=1000&&a>-1000&&b<=1000&&b>-1000)
    {
        if(a<b)
        {
            printf("a < b\n");
        }
        else if(a>b)
        {
            printf("a > b\n");
        }
        else if(a==b)
        {
            printf("a == b\n");
        }
    }
}


Measured memory_bytes: 2104
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()

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 (b<a) { a=b; return 1; } return 0; }

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

int main() {
  
  int n,max=0,c,num;
  cin>>n;
  
  vector<int> vec(n),sub(n);
  rep(i,n){
    int x;
    cin>>x;
    vec[i]=x;
    if(max<x){
      max=x;
      c=0;
      num=i;
    }
    else if(max==x){
      c++;
    }
  }
  
  sort(ALL(vec));
  int sec=vec[n-2];
  
  if(c){
    rep(i,n) cout << max <<endl;
  }
  else{
    rep(i,n){
      if(i != num) cout << max <<endl;
      else cout << sec <<endl;
    }
  }
  
  return 0;
}

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


int main() {
  int N,K;
  cin >> N >> K ;
  int X = 1;
  
  for(int i = 0; i < N; i++) {
    int A = X*2;
    int B = X+K;
    if( A < B ){
      X *= 2;} else {
      X += K;}
  }
  cout << X << endl;
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
typedef long long ll;

int main()
{
    int n;
    cin>>n;
    int ans=999999999;
    int memo;
    for(int i=1;i<=n/2+1;i++){
        memo=0;
        string a=to_string(i);
        string b=to_string(n-i);
        int aaa=a.size();
        int bbb=b.size();
        for(int j=0;j<aaa;j++){
            memo+=a[j]-'0';
        }
        for(int j=0;j<bbb;j++){
            memo+=b[j]-'0';
        }
        ans=min(ans,memo);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define V vector
#define VI vector<int>
#define VVI vector<vector<int>>
#define rep(i,n) for(int i=0;i<(n);i++)
#define MOD 1000000007


using namespace std;

int main(void){
    int a,b,c,d,e,f,sum;
    cin>>a>>b>>c>>d>>e>>f;
    sum=a+b*5+c*10+d*50+e*100+f*500;
    if(sum>=1000)cout<<1<<endl;
    else cout<<0<<endl;
}




Measured memory_bytes: 3116
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <iomanip>
using ll = long long;
using uint = unsigned int;
using graph = std::vector<std::vector<ll>>;
using wGraph = std::vector<std::vector<std::pair<ll,ll>>>;
#define rep(i,n) for (int i=0; i < int(n); i++)

using namespace std;
ll MOD7 = 1000000007;
ll MOD9 = 1000000009;
vector<ll> InputVec(ll N){
    vector<ll> A(N);
    for (int i = 0; i < N; ++i) {
        cin >> A[i];
    }
    return A;
}
void OutputVec(vector<ll> A){
    for (int i = 0; i < A.size(); ++i) {
        cout << A[i] << ",";
    }
    cout << endl;
}
vector<vector<ll>> InputVec2d(ll H,ll W){
    vector<vector<ll>> A(H);
    for (int yi = 0; yi < H; ++yi) {
        A[yi] = vector<ll>(W);
    }
    for (int yi = 0; yi < H; ++yi) {
        for (int xi = 0; xi < W; ++xi) {
            cin >> A[yi][xi];
        }
    }
    return A;
}
vector<vector<char>> InputVec2dStr(ll H,ll W){
    vector<vector<char>> A(H);
    for (int yi = 0; yi < H; ++yi) {
        A[yi] = vector<char>(W);
    }
    for (int yi = 0; yi < H; ++yi) {
        string S;
        cin >> S;
        for (int xi = 0; xi < W; ++xi) {
            A[yi][xi] = S[xi];
        }
    }
    return A;
}
void OutputVec2d(vector<vector<ll>> A){
    for (int yi = 0; yi < A.size(); ++yi) {
        for (int xi = 0; xi < A[yi].size(); ++xi) {
            cout << A[yi][xi] << ",";
        }
        cout << endl;
    }
}
graph InputGraph(ll N,ll M){
    graph G(N);
    for (int i = 0; i < M; ++i) {
        ll a,b;
        cin >> a >> b;
        a--;b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    return G;
}
graph InputDGraph(ll N,ll M){
    graph G(N);
    for (int i = 0; i < M; ++i) {
        ll a,b;
        cin >> a >> b;
        a--;b--;
        G[a].push_back(b);
    }
    return G;
}
void OutputGraph(graph G){
    for (int i = 0; i < G.size(); ++i) {
        cout << i << ":";
        for (int j = 0; j < G[i].size(); ++j) {
            cout << G[i][j]<< ",";
        }
        cout << endl;
    }
}
void OutputAnswerBool(bool b,bool isUpperCase = false){
    if(b){
        if(isUpperCase){
            cout << "YES" << endl;
        }else{
            cout << "Yes" << endl;
        }
    }else{
        if(isUpperCase){
            cout << "NO" << endl;
        }else{
            cout << "No" << endl;
        }
    }
}

int main() {
    ll N,A,B;
    cin >> N >> A >> B;
    auto P =InputVec(N);
    ll c1,c2,c3;
    c1 = 0;c2 = 0;c3 = 0;
    for (int i = 0; i < N; ++i) {
        if(P[i] <= A){
            c1++;
        }else if(P[i]<=B){
            c2++;
        }else{
            c3++;
        }
    }
    cout << min(c1,min(c2,c3)) << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>
#include <unordered_set>
#include <random>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)


























int main(){
    ll n;
    cin >> n;
    vector<ll> a(n);
    REP(i, n){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    vector<bool> f(1000005, true);
    REP(i, n){
        if(i > 0 && a[i] == a[i - 1]) f[a[i]] = false;
        if(f[a[i]]){
            for(ll j = a[i] * 2; j < 1000005; j += a[i]){
                f[j] = false;
            }
        }
    }
    ll ans = 0;
    REP(i, n){
        if(f[a[i]]) ans++;
    }
    cout << ans << endl;
    
}


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

using namespace std;

#define ALL(x) x.begin(), x.end()

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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.precision(15);
	cout << fixed;

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

	cout << max(a + b, max(a - b, a * b)) << '\n';

	return 0;
}

Measured memory_bytes: 256