akhauriyash/Code-Regression huggingface dataset:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

h, w, k = LI()
G = SRL(h)
no_s = set()
ret = 1
for y in range(h):
    flag = 0
    for x in range(w):
        if G[y][x] == '#':
            flag = 1
            G[y][x] = ret
            for i in range(x + 1, w):
                if G[y][i] == '.':
                    G[y][i] = ret
                else:
                    break
            for i in range(x - 1, -1, -1):
                if G[y][i] == '.':
                    G[y][i] = ret
                else:
                    break
            ret += 1
    if flag == 0:
        no_s.add(y)


for i in set(range(h)) - no_s:
    i_plus = i + 1
    i_minus = i - 1
    while i_plus in no_s:
        for j in range(w):
            G[i_plus][j] = G[i][j]
        i_plus += 1
    while i_minus in no_s:
        for j in range(w):
            G[i_minus][j] = G[i][j]
        i_minus -= 1


for k in G:
    print(*k)

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

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);
	string a,b;
	cin>>a>>b;
	int token=0,i=0,j=0;
	int len=a.size()+b.size();
	while(i+j<len){
		if(token) cout<<b[j++];
		else cout<<a[i++];
		token^=1;
	}
	cout<<endl;
}




Measured memory_bytes: 3536
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<sstream>
#include<complex>
#include<functional>
#include<vector>
#include<map>
#include<queue>
#include<deque>
#include<stack>
#include<set>

using namespace std;
#define endl '\n'
#define eb emplace_back
#define fst first
#define scd second
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl

constexpr int MOD = 1000000007;

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

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }

// value
string S;

void solve() {

	cin >> S;

	int f = stoi(S.substr(0, 2));
	int l = stoi(S.substr(2, 2));

	bool yf = false, yl = false, mf = false, ml = false;

	if (0 <= f && f <= 99) {
		yf = true;
	}
	if (1 <= f && f <= 12) {
		mf = true;
	}

	if (0 <= l && l <= 99) {
		yl = true;
	}
	if (1 <= l && l <= 12) {
		ml = true;
	}

	if (yf == true && ml == true) {
		if (mf == true && yl == true) {
			cout << "AMBIGUOUS" << endl;
		}
		else {
			cout << "YYMM" << endl;
		}
	}
	else if (mf == true && yl == true) {
		cout << "MMYY" << endl;
	}
	else {
		cout << "NA" << endl;
	}

	return;

}

int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);

	solve();

	return 0;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define dbg(x) cout<<#x<<"="<<x
#define nl cout<<"\n"
#define frn(i,n) for(int i = 0;i < n;i++)
#define fr(i,a,b) for(int i = a;i < b;i++)
#define pb push_back
using namespace std;


int main() {
  int n;
  cin>>n;
  int a[n];
  frn(i,n) cin>>a[i];
  cout<<*max_element(a, a+n) - *min_element(a, a+n);
}

Measured memory_bytes: 256
class Building
    attr_accessor :residents
    def initialize(residents:)
        self.residents = residents 
    end

    def move(floor,room_num,num)
        self.residents[floor-1][room_num-1] += num
        if self.residents[floor-1][room_num-1].negative? 
            self.residents[floor-1][room_num-1] = 0
        end
    end

    def info
        return "#{self.residents}"
    end

    def floor_info
        self.residents.each do |floor|
            for i in 0..floor.length-1 do
                print(" #{floor[i]}")
            end
            puts ""
        end
    end
end

def border
    puts "#" * 20
end

# 初期設定
building1 = Building.new(residents: Array.new(3).map{Array.new(10,0)})
building2 = Building.new(residents: Array.new(3).map{Array.new(10,0)})
building3 = Building.new(residents: Array.new(3).map{Array.new(10,0)})
building4 = Building.new(residents: Array.new(3).map{Array.new(10,0)})

buildings = [building1,building2,building3,building4]

n = gets.chomp.to_i
for i in 1..n do
    b,f,r,v = gets.chomp.split.map(&:to_i)
    buildings[b-1].move(f,r,v)
end
index = 0
buildings.each do |building|
    building.floor_info
    if index < 3
        border
    end
    index += 1
end



Measured memory_bytes: 6908
#include<bits/stdc++.h>
using namespace std;
const int Maxn=1e5+100;
const long long Mod=1e9+7;
long long ans,a,t[Maxn],n;
int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a;
		t[a]++;
	}
	ans=1;
	if(n%2==1){
		for(int i=0;i<n;i+=2){
			if((i!=0 && t[i]!=2) || (i==0 && t[i]!=1)){
				cout<<0;
				return 0;
			}
			if(i!=0)
				ans=(ans*2)%Mod;
		}
		cout<<ans;
	}
	else{
		for(int i=1;i<n;i+=2){
			if(t[i]!=2){
				cout<<0;
				return 0;
			}
			ans=(ans*2)%Mod;
		}
		cout<<ans;
	}
}


Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <array>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>

using namespace std;
using lli = long long int;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (lli i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (lli i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

string s;
int main() {
  cin >> s;
  lli n = s.size();

  lli ans = 0;
  string stk;
  for (char c : s) {
    if (!stk.empty() && c != stk.back()) {
      stk.pop_back();
      ans += 2;
    } else {
      stk.push_back(c);
    }
  }
  cout << ans << '\n';
  return 0;
}


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

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<vector>
#include<map>
#include<string>
#include<sstream>
#include<cmath>
#include<climits>
#include<algorithm>
#include<bitset>
#include<set>
#include<stack>
#include<queue>
#include<iomanip>
#include<memory.h>
#include<complex>
using namespace std;  
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef tuple<int,int> tii;
#define rep(i,n) for(ll i=0;i<(n);i++)  
#define pb push_back
#define mt make_tuple
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second  
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-5;
const double PI = M_PI;  
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define SHOWARRAY(ar,i,j) REP(a,i)REP(b,j)cerr<<ar[a][b]<<((b==j-1)?((a==i-1)?("\n\n"):("\n")):(" "))
#define DIV int(1e9+7)
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
 
/* Coding Space*/

int opt[1 << 26] = {}; // dp[hash] = min
int dp[200001] = {}; // dp[i] = can sparate ans[i] area.

int main(){
  string s; cin >> s;
  fill_n(opt,1<<26,INF);
  fill_n(dp,200001,INF);
  dp[0] = opt[0] = 0;
  int d = 0;
  rep(i,s.size()){
    d ^= 1<<(s[i] - 'a');
    rep(j,26)
      dp[i+1] = min(dp[i+1],opt[d^(1<<j)]+1);
    dp[i+1] = min(dp[i+1],opt[d]+1);
    opt[d] = min(opt[d],dp[i+1]);
  }
  
  cout << dp[s.size()] << endl;
  
  return 0;
}

Measured memory_bytes: 263556
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <string>
#include <bitset>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define fin(ans) cout<<(ans)<<endl
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p,q)
#define pb(n) push_back(n)
#define Sort(a) sort(a.begin(),a.end())
#define Rort(a) sort(a.rbegin(),a.rend())
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const int P = 1000000007;
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
//g++ -std=c++1z temp.cpp
//./a.out


string jfen(vs v){
    string s;
    for(int i=0;i<v.size();i++){
        for(int j=0;j<v[i].size();j++){
            int num=0;
            while(j<v[i].size()&&v[i][j]=='.'){
                num++;
                j++;
            }
            if(num==0){
                s+='b';
            }
            else{
                s+=char(num+'0');
                j--;
            }
        }
        s+='/';
    }
    s=s.substr(0,s.size()-1);
    return s;
}

int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
	string s;
    int a,b,c,d;
    while(1){
        cin>>s;
        if(s=="#")break;
        cin>>a>>b>>c>>d;
        vs v(1,"");
        int h=0;
        for(int i=0;i<s.size();i++){
            if(s[i]=='/'){
                // v[h].push_back('/');
                v.push_back("");
                h++;
            }
            else if(s[i]<='9'&&s[i]>='0'){
                for(int j=0;j<s[i]-'0';j++){
                    v[h]+='.';
                }
            }
            else{
                v[h]+=s[i];
            }
        }
        // v[h].push_back('%');
        //move
        v[a-1][b-1]='.';
        v[c-1][d-1]='b';
        cout<<jfen(v)<<endl;
    }
    
/////////////////////////////////////////////////////
return 0;}



Measured memory_bytes: 3232
#include<stdio.h>

int main(){
     int K,A,B;
     int Count= 0;
     scanf("%d",&K);
     scanf("%d %d",&A,&B);
     for(int i=A;i<=B;i++){
         if(i%K==0){
             Count++;
         }
     }    
     
     if(Count > 0){
              printf("OK\n");
     } else {
              printf("NG\n");
     }





    return 0;
}

Measured memory_bytes: 1664
#include <iostream>
#include <vector>

#define rep(i,x) for(int i=0;i<x;i++)
using ll = long long;
using namespace std;

int main(){
    vector<pair<int, int>> bingo(9, pair<int, int>{0, 0});
    rep(i, 9){
        int a;
        cin >> a;
        bingo[i].first = a;
    }
    int n; cin >> n;
    rep(i, n){
        int b; cin >> b;
        rep(j, 9){
            if (bingo[j].first == b){
                bingo[j].second = 1;
            }
        }
    }
    string ans = "No";
    rep(i, 3){
        if (bingo[i].second == 1 and bingo[i+3].second == 1 and bingo[i+6].second == 1) ans = "Yes";
    }
    rep(i, 3){
        if(bingo[3*i].second == 1 and bingo[3*i + 1].second == 1 and bingo[3*i+2].second == 1) ans = "Yes";
    }
    if (bingo[0].second == 1 and bingo[4].second == 1 and bingo[8].second == 1) ans = "Yes";
    if (bingo[2].second == 1 and bingo[4].second == 1 and bingo[6].second == 1) ans = "Yes";
    cout << ans << endl;
}


Measured memory_bytes: 256
n, m = map(int, input().split())
lr = [list(map(int, input().split())) for i in range(m)]
a = 0
b = 100001
for i in range(m):
	a = max(a, lr[i][0])
	b = min(b, lr[i][1])
if b-a < 0:
	print (0)
else:
	print (b-a+1)

Measured memory_bytes: 27332
n = int(input())
s = list(map(int, input().split()))

for i in range(n):
    v = s[i]
    j = i - 1
    while j >= 0 and s[j] > v:
        s[j+1] = s[j]
        j -= 1
    s[j+1] = v

    print(*s)


Measured memory_bytes: 5976
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner stdIn = new Scanner(System.in);
		int D = stdIn.nextInt();
		int T = stdIn.nextInt();
		int S = stdIn.nextInt();
		
		if((double)D / S <= T) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 35764
/// @pSaurabh

#include <bits/stdc++.h>

using namespace std;

#define read(a, n) for(int i = 0; i < n; i++) cin >> a[i];
#define print(a, n) for(int i = 0; i < n; i++) cout << a[i] << " ";

typedef long long ll;
const ll mod = 1e9 + 7;

void fast(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout .tie(0);
}

int main(){
	// fast();

	int n;
	cin >> n;

	int h[n];
	read(h, n);

	int dp[n + 1];
	dp[0] = 0;
	dp[1] = abs(h[1] - h[0]);

	for(int i = 2; i < n; i++){
		int c1 = dp[i - 1] + abs(h[i] - h[i - 1]);
		int c2 = dp[i - 2] + abs(h[i] - h[i - 2]);
		dp[i] = min(c1, c2);
	}

	cout << dp[n - 1];

	return 0;
}


Measured memory_bytes: 1024
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=b;i--)
#define ALL(x) x.begin(),x.end()
#define SIZE(x) ll(x.size())

#define INF 1000000000000 //10^12
#define MOD 1000000007 //10^9+7:合同式の法


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

    if(h==1 || w==1){
        cout << 1 << endl;
        return 0;
    }
    if(h%2==0 && w%2==0){
        cout << h*w/2 << endl;
        return 0;
    }
    else if(h%2==0 && w%2!=0){
        cout << h*(w-1)/2 + h/2 << endl;
        return 0;
    }
    else if(h%2!=0 && w%2==0){
        cout << (h-1)*w/2 + w/2 << endl;
        return 0;
    }
    else if(h%2!=0 && w%2!=0){
        cout << (h*w+1)/2 << endl;
        return 0;
    }
    //return 0;
}

Measured memory_bytes: 3572
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll n,m,k;
ll a[200010],b[200010];
bool can(ll x)
{
    for(int i=0;i<=x;i++)
    {
        if(i<x-m)
        {
            continue;
        }
        if(i>n)
        {
            return false;
        }
        if(a[i]+b[x-i]<=k)
        {
            return true;
        }
    }
    return false;
}
int main()
{
    scanf("%lld%lld%lld",&n,&m,&k);
    for(int i=1;i<=n;i++)
    {
        ll x;
        scanf("%lld",&x);
        a[i]=a[i-1]+x;
    }
    for(int i=1;i<=m;i++)
    {
        ll x;
        scanf("%lld",&x);
        b[i]=b[i-1]+x;
    }
    ll s=0,e=n+m;
    while(s<e)
    {
        ll mid=(s+e+1)/2;
        if(can(mid))
        {
            s=mid;
        }
        else
        {
            e=mid-1;
        }
    }
    printf("%lld",s);
}


Measured memory_bytes: 6848
#include<algorithm>
#include<cstring>
#include<cctype>
#include<cstdio>
#define rep(i,x,y) for(int i=x; i<=y; ++i)

using namespace std;
const int N=1005;
int n,pool[N],bin[40];
struct point{int x,y;} dat[N];

int getint()
{
	char ch;
	int f=1;
	while(!isdigit(ch=getchar())) if(ch=='-') f=-1;
	int x=ch-48;
	while(isdigit(ch=getchar())) x=x*10+ch-48;
	return x*f;
}

void dfs(int x,int y,int d=30)
{
	if(d<0) return;
	if(abs(x)>abs(y))
	{
		if(x>0) dfs(x-bin[d],y,d-1),putchar('R');
		else dfs(x+bin[d],y,d-1),putchar('L');
	}
	else
	{
		if(y>0) dfs(x,y-bin[d],d-1),putchar('U');
		else dfs(x,y+bin[d],d-1),putchar('D');
	}
}

void solve(int x,int y)
{
	if(!((x+y)&1)) dfs(x,y-1),putchar('U');
	else dfs(x,y);
	puts("");
}

int main()
{
	n=getint();
	rep(i,1,n) dat[i].x=getint(),dat[i].y=getint(),pool[i]=dat[i].x+dat[i].y;
	rep(i,2,n) if((pool[i]-pool[1])&1) return puts("-1"),0;
	rep(i,0,30) bin[i]=1<<i;
	printf("%d\n",31+(!(pool[1]&1)));
	rep(i,0,30) printf("%d ",bin[i]);
	if(!(pool[1]&1)) printf("1 ");
	puts("");
	rep(i,1,n) solve(dat[i].x,dat[i].y);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <queue>
#include <limits>
#include <algorithm>
#include <string>
#include <set>
using namespace std;

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

	vector<int32_t> a(N);
	for (int32_t i = 0; i < N; i++)
		cin >> a[i];

	int32_t res = 0;
	for (int32_t i = 0; i < N; i++) {
		while (a[i] % 2 == 0) {
			a[i] /= 2;
			res++;
		}
	}
	cout << res << endl;

	return 0;
}


Measured memory_bytes: 256
#line 2 "../../library/template.hpp"
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0; i < (ll)n; i++)
#define rep3(i, l, r) for(ll i = l; i < (ll)r; i++)
#define per(i, n) for(ll i = (ll)n-1; i >= 0; i--)
#define per3(i, l, r) for(ll i = (ll)r-1; i >= (ll)l; i--)
#define all(v) begin(v), end(v)
template<class T, class U>
inline void cmax(T& a, U b) { if (a < b) a = b; }
template<class T, class U>
inline void cmin(T& a, U b) { if (a > b) a = b; }

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    cerr << fixed << setprecision(15);
  }
} io_setup;

constexpr char el = '\n';

template<typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U>& p) {
  os << p.first << " " << p.second;
  return os;
}
template<typename T, typename U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.first >> p.second;
  return is;
}
template<typename T>
ostream &operator<<(ostream &os, const vector< T > &v) {
  rep(i, v.size())
    os << v[i] << (i + 1 != v.size() ? " " : "");
  return os;
}
template<typename T>
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}
#line 2 "d.cpp"

int main() {
  ll k;
  cin >> k;

  ll d = 1;
  vl x(20);
  x[0] = 1;
  while (--k) {
    bool f = 0;
    rep(i, d) {
      if (!f and x[i] != 9 and (i == d-1 or x[i] != x[i+1]+1)) {
        x[i]++;
        per(j, i) {
          x[j] = max(x[j+1]-1, 0LL);
        }
        f = 1;
      }
    }

    if (f) continue;

    // 99999
    x[d] = 1;
    rep(i, d) {
      x[i] = 0;
    }
    d++;
  }

  per(i, d) {
    cout << x[i];
  }
  cout << el;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define CK(N, A, B) (A <= N && N < B)
#define REP(i, a, b) for (int i = a; i < b; i++)
#define RREP(i, a, b) for (int i = (b - 1); a <= i; i--)
#define F first
#define S second
#define ll long long

const int INF = 1e9;
const long long LLINF = 1e18;

using namespace std;

/*==================================================*/

/*==================================================*/

int main() {

    int a[3];
    map<int, int> m;
    REP(i,0,3) cin>>a[i], m[a[i]]++;

    REP(i,0,3) {
        if(m[a[i]] == 1){
            cout<<a[i]<<endl;
        }
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;   
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sz(a) (ll)(a.size())
ll solve(ll x)
{
	if(x==0)
		return 0;
	return 1+2*solve(x/2);
}
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll h;
	cin>>h;
	cout<<solve(h)<<"\n";
	return 0;
}

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

int main(){
    int n, k;
    std::cin >> n >> k;

    std::string s;
    std::cin >> s;

    s.at(k - 1) = s.at(k - 1) + 32;
    
    std::cout << s << std::endl;

    return 0;
}


Measured memory_bytes: 888
program prob3
    implicit none
    character(len=200005) :: s
    integer, allocatable :: dp1(:), dp2(:)
    integer :: n, m

    read(*,*) s
    n = len_trim(s)
    allocate(dp1(n))
    allocate(dp2(n))
    
    dp1(1) = 1
    dp1(2) = 1
    dp2(1) = 0
    dp2(2) = 1
    if(s(1:1) /= s(2:2)) then
        dp1(2) = dp1(2) + 1
    end if

    do m = 3, n
        if(s(m-1:m-1) == s(m:m)) then
            dp1(m) = dp2(m-1) + 1
        else
            dp1(m) = max(dp1(m-1) + 1, dp2(m-1) + 1)
        end if
        if(m == 3) then
            dp2(m) = dp1(m-2) + 1
        else if(s(m-3:m-2) == s(m-1:m)) then
            dp2(m) = dp1(m-2) + 1    
        else
            dp2(m) = max(dp1(m-2) + 1, dp2(m-2) + 1)
        end if
    end do

    write(*,*) max(dp1(n), dp2(n))

    deallocate(dp2)    
    deallocate(dp1)
    stop
contains
end program prob3

Measured memory_bytes: 2316
#include <iostream>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <utility>
#include <typeinfo>
#include <tuple>
using namespace std;

#define MOD 1000000007
#define INF 1e9+7
#define INF_LONG 1e18
#define rep(i, n) for(int i=0; i<n; ++i)
#define rep1(i, n) for(int i=1; i<=n; ++i)
#define rrep(i, m, n) for(int i=m; i<n; ++i)
#define countof(array) (sizeof(array) / sizeof(array[0]))
typedef long long ll;

#define MAX_N 100000
#define MAX_M 100000
#define MAX_V 100
#define MAX_E 100
#define MAX_Q 100000

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

int ddx[] = {-1, 0, 1, 0, -1, 1, -1, 1};
int ddy[] = {0, -1, 0, 1, 1, 1, -1, -1};

string ab = {"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
string as = {"abcdefghijklmnopqrstuvwxyz"};

ll gcd(ll x, ll y) {
  if(y==0) return x;
  else return gcd(y, x%y);
}

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

void yes() {
  cout << "Yes" << endl;
}

void no() {
  cout << "No" << endl;
}

void print_array(int array[], int len) {

  for(int i=0; i<len; ++i) {
    cout << array[i] << endl;
  }

}

ll absolute(ll x) {
  return (x<0)? (-1)*x : x;
}

//g++ AtCoder.cpp -o AtCoder
//AtCoder

//--------------------------
//提出するときC++に帰る
//--------------------------

int main() {

  string s, t;
  cin >> s >> t;

  bool flag = true;
  rep(i, s.size()) {
    if(s[i]!=t[i]) {
      flag = false;
      break;
    }
  }

  if(flag) yes();
  else no();

  return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
int main() {
    int a,b,d=0,r;
    string key[257],s[2]={"Opened by ","Closed by "},in;
    for(cin>>a;a>0;a--)cin>>key[a];
    for(cin>>b;b>0;b--){
        cin>>in;
        r=1;
        for(int j=1;j<257;j++)if(key[j]==in){
            cout<<s[d]<<in<<endl;
            d=++d%2;
            r=0;
        }
        if(r)cout<<"Unknown "<<in<<endl;
    }
}

Measured memory_bytes: 1224
#include<iostream>
using namespace std;
int main(){
  int N,M,C;
  cin >> N >> M >> C;
  int B[M], A[N][M];
  for(int i=0; i<M; i++) cin >> B[i];
  for(int i=0; i<N; i++) for(int j=0; j<M; j++) cin >> A[i][j];
  int count = 0;
  for(int i=0; i<N; i++){
    int sum=0;
    for(int j=0; j<M; j++) sum += A[i][j]*B[j];
    if(sum+C > 0) count++;
  }
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 256
N =int(input())
H = [int(x) for x in input().split()]
h=0
l=0
memo = 0
for i in range(N):
    if H[i]>=h:
        h=H[i]
    elif H[i]<h and H[i]>=l:
        l=H[i]
    else:
        memo+=1
for i in range(N):
    if i==N-1:
        break
    elif H[i]-H[i+1]>=2:
        memo+=1

if memo>=1:
    print('No')
else:
    print('Yes') 

Measured memory_bytes: 14396
import math
n,k=map(int,input().split())
a=list(map(int,input().split()))
t=a[0]
for i in range(1,n):
  t=math.gcd(t,a[i])
if k%t!=0 or k>max(a):
  print('IMPOSSIBLE')
else:
  print('POSSIBLE')

Measured memory_bytes: 84888
module Color
  WHITE = 0
  GRAY = 1
  BLACK = 2
end

def prim()
  d = Array.new($n, Float::INFINITY)
  color = Array.new($n, Color::WHITE)
  p = Array.new($n, -1)
  
  d[0] = 0

  while true
    mincost = Float::INFINITY
    u = nil
    $n.times do |i|
      if color[i] != Color::BLACK && d[i] < mincost
        mincost = d[i]
        u = i
      end
    end

    if mincost == Float::INFINITY
      break
    end

    color[u] = Color::BLACK

    $n.times do |v|
      if color[v] != Color::BLACK && $m[u][v] != Float::INFINITY
        if $m[u][v] < d[v]
          d[v] = $m[u][v]
          p[v] = u
          color[v] = Color::GRAY
        end
      end
    end
  end
  sum = 0
  $n.times do |i|
    if p[i] !=- 1
      sum += $m[i][p[i]]
    end
  end
  sum
end

$n = gets.to_i
$m = Array.new($n) { Array.new($n) }
$n.times do |i|
  arr = gets.split.map(&:to_i)
  $n.times do |j|
    $m[i][j] = arr[j] == -1 ? Float::INFINITY : arr[j]
  end
end
puts prim()



Measured memory_bytes: 7076
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc=new Scanner(System.in);
    int H=sc.nextInt();
    int W=sc.nextInt();
    int h=sc.nextInt();
    int w=sc.nextInt();
    System.out.println(H*W-h*W-H*w+h*w);
  }
}


Measured memory_bytes: 23252
#include <bits/stdc++.h>
#include <boost/multi_array.hpp>
#include <boost/range/algorithm.hpp>
#define rep(i,n) for (int i=0; i< (n); ++i)
using namespace std;
typedef long long ll;

int main() {
  string s;
  cin >> s;
  int n = s.length();
  vector<int> result(n,0);
  char prev = 'R';
  char curr;
  int count = 0;
  int pari = 0;
  rep(i,n){
    curr = s[i];
    if(prev=='R'&&curr=='R'){
      count++;
    }
    else if(prev=='R'&&curr=='L'){
      rep(j,count){
        result[i-(j+count)%2]++;
      }
      count = 1;
    }
    else if(prev=='L'&&curr=='L'){
      count++;
    }
    else if((prev=='L'&&curr=='R')){
      rep(j,count){
        result[i-count-1+(j+count)%2]++;
      }
      count = 1;
    }
    if(i==n-1){
      rep(j,count){
        result[i-count+(j+count)%2]++;
      }
    }
    prev = curr;   
  }
  rep(i,n-1){
    cout << result[i] << " ";
  }
  cout << result[n-1] << endl;

  return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int comp(char a[], char b[]){
    int i=0;
    while(a[i] != '\0'){
        if(a[i] != b[i]){
            return a[i] - b[i];
        }
        i++;
    }
    return 0;
}
void sort1(char x[], int n){
    int i, j;
    char y;
    for(i=n; i>1; i--){
        for(j=0; j<=i-2; j++){
            if(x[j] > x[j+1]){
                y = x[j];
                x[j] = x[j+1];
                x[j+1] = y;
            }
        }
    }
}
void sort2(char x[], int n){
    int i, j;
    char y;
    for(i=n; i>1; i--){
        for(j=0; j<=i-2; j++){
            if(x[j] < x[j+1]){
                y = x[j];
                x[j] = x[j+1];
                x[j+1] = y;
            }
        }
    }
}
int main(void){
    char s[101];
    char t[101];
    int i=0;
    int sl=0, tl=0;
    
    scanf("%s", s);
    scanf("%s", t);
    
    while(s[i] != '\0'){
        sl++;
        i++;
    }
    i = 0;
    while(t[i] != '\0'){
        tl++;
        i++;
    }
    
    sort1(s, sl);
    sort2(t, tl);
    
    //printf("%d\n", comp(s, t));
    
    if(comp(s, t) < 0 || (comp(s, t) == 0 && sl < tl)){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
    
    return 0;
}

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

typedef pair<int,int> P;

#define fr first
#define sc second

int main(){
	static int n;
	static int a[100010];
	static int p[100010];
	scanf("%d",&n);
	for(int i = 1 ; i <= n ; i ++){
		scanf("%d",&a[i]);
	}
	if(n == 2){
		puts("-1");
		return 0;
	}
	if(n <= 10){
		int q[12];
		for(int i = 0 ; i < n ; i ++){
			q[i] = i+1;
		}
		do{
			for(int i = 1 ; i <= n ; i ++){
				p[i] = q[i-1];
			}
			bool ret = true;
			for(int i = 1 ; i+1 <= n ; i ++){
				ret &= a[p[i]] != p[i+1];
			}
			if(ret){
				for(int j = 1 ; j <= n ; j ++){
					printf("%d%c",p[j],(j==n)?'\n':' ');
				}
				return 0;
			}
		}while(next_permutation(q,q+n));
	}
	
	static int cnt[100010];
	//static bool used[100010];
	static set<int> S;
	for(int i = 1 ; i <= n ; i ++){
		cnt[a[i]] ++;
		//used[i] = false;
		S.insert(i);
	}
	priority_queue<P> que;
	for(int i = 1 ; i <= n ; i ++){
		que.push(P(cnt[i],i));
	}
	
	for(int i = 1 ; i <= n-10 ; i ++){
		while(que.top().fr >= n-i){
			P q = que.top(); que.pop();
			if(cnt[q.sc] == n-i){
				p[i] = q.sc;
				S.erase(q.sc);
				//used[q.sc] = true;
				int loc = i+1;
				for(set<int>::iterator itr = S.begin() ; itr != S.end() ; itr++){
					p[loc] = *itr;
					loc ++;
				}
				/*vector<int> vec;
				for(int j = 1 ; j <= n ; j ++){
					if(!used[j])vec.push_back(j);
				}
				for(int j = 0 ; j < vec.size() ; j ++){
					p[i+1+j] = vec[j];
				}*/
				if(a[q.sc] == *S.begin()){
					swap(p[i+1],p[i+2]);
				}
				for(int j = 1 ; j <= n ; j ++){
					printf("%d%c",p[j],(j==n)?'\n':' ');
				}
				return 0;
			}
		}
		if(i == 1 || a[p[i-1]] != *S.begin()){
			p[i] = *S.begin();
			S.erase(S.begin());
		}
		else {
			set<int>::iterator itr = S.begin();
			itr++;
			p[i] = *itr;
			S.erase(itr);
		}
		cnt[p[i]] = 0;
		cnt[a[p[i]]]--;
		que.push(P(cnt[a[p[i]]],a[p[i]]));
	}
	
	int q[10];
	int ind = 0;
	for(set<int>::iterator itr = S.begin() ; itr != S.end() ; itr ++){
		q[ind] = *itr;
		ind ++;
	}
	do{
		for(int i = 0 ; i < 10 ; i ++){
			p[n-9+i] = q[i];
		}
		bool ret = true;
		for(int i = 0 ; i < 10 ; i ++){
			if(n-10+i == 0)continue;
			ret &= a[p[n-10+i]] != p[n-9+i];
		}
		if(ret){
			for(int j = 1 ; j <= n ; j ++){
				printf("%d%c",p[j],(j==n)?'\n':' ');
			}
			return 0;
		}
	}while(next_permutation(q,q+10));
}

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

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

	int x0 = 0, xm = w, y0 = 0, ym = h;
	
	for( int i = 0; i < n; i++ ) {
		int x, y, a;
		cin >> x >> y >> a;

		if( a == 1 ) {
			if( x0 < x ) {
				x0 = x;
			}
		}
		if( a == 2 ) {
			if( xm > x ) {
				xm = x;
			}
		}
		if( a == 3 ) {
			if( y0 < y ) {
				y0 = y;
			}
		}
		if( a == 4 ) {
			if( ym > y ) {
				ym = y;
			}
		}
	}
	if( xm < x0 ) {
		xm = 0, x0 = 0;
	}
	if( ym < y0 ) {
		ym = 0, y0 = 0;
	}

	cout << ( xm - x0 ) * ( ym - y0 ) << endl;
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
const int MAXN=105;

int N;
int a[MAXN];

int main()
{
	scanf("%d",&N);
	for(int i=1;i<=N;i++)
		scanf("%d",&a[i]);
	int ans=0x7FFFFFFF;
	for(int s=-100;s<=100;s++)
	{
		int sum=0;
		for(int i=1;i<=N;i++)
			sum+=(s-a[i])*(s-a[i]);
		ans=min(ans,sum);
	}
	printf("%d\n",ans);
	
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <string>
#include <numeric>
#include <vector>
#include <queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define ii pair<int,int>
#define MAX 1000000007

using namespace std;


int main(void){
	int n;
	cin >> n;
	int num_l[n+1],num_r[n+1];
	num_l[0] = 0;
	num_r[0] = 0;
	rep(i,n){
		char c;
		cin >> c;
		if(c == 'W'){
			num_l[i+1] = num_l[i]+1;
			num_r[i+1] = num_r[i];
		}
		else{
			num_l[i+1] = num_l[i];
			num_r[i+1] = num_r[i]+1;
		}
		//cout << num_l[i+1] << " " << num_r[i+1] << endl;
	}
	

	ll ans = MAX;
	for(int i=0;i<n;i++){
		if(ans > num_l[i]+num_r[n]-num_r[i+1])ans = num_l[i]+num_r[n]-num_r[i+1];
	}

	cout << ans << endl;
	return 0;

}


Measured memory_bytes: 2560
#include<stdio.h>
#include<string.h>

int main(void)
{
  int i,j,len,flag=0,tmp;
  char s[101],t[101];
  scanf("%s",s);
  scanf("%s",t);
  len = strlen(s);
  for(i=0;i<len;i++)
    {
      flag = 0;
      for(j=0;j<len;j++)
	{
	  tmp = (i+j)%len;
	  if(s[tmp] != t[j])
	    {
	      flag = 1;
	      break;
	    }
	}
      if(flag == 0)
	{
	  printf("Yes\n");
	  return 0;
	}
    }
  printf("No\n");
  return 0;
}
	   

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)
#define repa(i,n) for (auto& i: n)

template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cerr << a[i] << " "; cerr << "\n" << flush; }
ll dbgt = 1; void err() { cerr << "passed " << dbgt++ << "\n" << flush; }
template<class H, class... T> void err(H&& h,T&&... t){ cerr<< h << (sizeof...(t)?" ":"\n") << flush; if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

const ll INF = 4e18;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
//--------------------------------------------------------------------------------//

int main() {
    init();
    char a;
    cin >> a;
    if('a'<= a and a <= 'z')
        cout << 'a' << endl;
    else
        cout << 'A' << endl;
}

Measured memory_bytes: 3632
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
class Main{
  public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int[] ls = Arrays.stream(bf.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        int[] ls2 = Arrays.stream(bf.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        for (int i = 0; i < ls[1]; i++){
            ls[0] -= ls2[i];
            if(ls[0] < 0)
                break;
        }
        
        System.out.println(ls[0] < 0 ? -1 : ls[0]);
    }
}

Measured memory_bytes: 36352
#include <iostream>
#include <set>
#include <map>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <climits>
#include <math.h>
#include <cassert>
#include <unordered_map>
#include <chrono>
#include <random>
#include <ctime>
using namespace std;
#pragma warning(disable : 4996)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const ld PI = 3.14159265358979323846;
const ll MOD = 1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll INF = 1e16;



int main() {
#ifdef _DEBUG
	freopen("input1.txt", "r", stdin);
	freopen("output2.txt", "w", stdout);
#endif
	srand(time(0));
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	string s;
	cin >> s;
	int cnt = 0, ans = 0;
	for (auto i : s)if (i == 'R')cnt++;
	for (int i = 0; i < cnt; i++)if (s[i] == 'W')ans++;
	cout << ans;
}

Measured memory_bytes: 3784
import numpy as np
N,M=map(int,input().split())
ary_list = []
for i in range(M):
    S = list(map(int,input().split()))
    S.pop(0)
    ary_list.append(S)
P_list = list(map(int,input().split()))
check = True
count = 0
swith = np.array([False]*N)
for i in range(2**N):
    for j in range(N):
        if ((i>>j)&1):
            swith[j] = True
        else:
            swith[j] = False
    for k,p in zip(ary_list,P_list):
        if(list(swith[np.array(k)-1]).count(True)%2!=p):
            check = False
    if(check):
        count+=1
    check=True
print(count)

Measured memory_bytes: 27168
dic = {}

while 1:
	try:
		name, page = raw_input().split()
		page = int(page)
		
		if dic.get(name):
			dic[name] += [page]
		else:
			dic[name] = [page]
	except:
		break

dic = sorted(dic.items())

for name, page in dic:
	page.sort()
	print name
	for i in range(len(page) - 1):
		print page[i],
	
	print page[-1]

Measured memory_bytes: 4220
#include <bits/stdc++.h>
//#include <ext/numeric>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define oo 0x3f3f3f3f
#define OO 0x3f3f3f3f3f3f3f3f
#define popcount(n) __builtin_popcount(n)
#define popcountll(n) __builtin_popcountll(n)

using namespace std;
//using namespace __gnu_cxx;
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const double PI = acos(-1.0), EPS = 1e-6;
const long long inf = 2e12 + 12;
const int MAXN = 200005, MAXM = 3003, Mod = 1000000007 , MAXLog = 20;

int main() {
#ifndef ONLINE_JUDGE
//    freopen("input.txt", "rt", stdin);
//    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0), cout.precision(10), cout << fixed;


    //1 -> 2 -> 3 -> 4 -> 5 -> 6

    vector<long long> arr(6);
    for (int i = 0; i < 6; ++i) {
        cin >> arr[i];
    }

    long long mn = LLONG_MAX;
    int idx = -1;
    for (int i = 1; i < 6; ++i) {
        if (arr[i] < mn) {
            mn = arr[i];
            idx = i;
        }
    }

    long long ans = idx - 1;
    ans += arr[0] / mn + (arr[0] % mn != 0);
    ans += 5 - idx;
    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
using namespace std;
#define INF 1000000007
#define LINF 100000000000000007
#define MOD 1000000007
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define repb(i, n) for (int i = n - 1; i >= 0; i--)
#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
typedef long long ll;
typedef pair<int,int> P;
struct edge{int to,cost;};
int ceil2(int a,int b){if(a%b){return a/b+1;}else{return a/b;}}
using namespace std;
 
signed main(void){
    int n,m;
    string s,t,r;
    cin>>s>>t;
    cin>>n>>m>>r;
    if(s==r)n--;
    if(t==r)m--;
    cout<<n<<" "<<m<<endl;
   
}


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

void Main() {
    // input
    long long N;
    u_int32_t M;
    cin >> N >> M;
    for (u_int32_t i = 0; i < M; i++) {
        u_int32_t A;
        cin >> A;
        N -= A;
        if (N < 0) {
            cout << -1 << endl;
            return;
        }
    }

    cout << N << endl;

    // translate


    // output

}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3640
#include<stdio.h>
void maxHeapify(int *A,int i);
void buildMaxHeap(int *A);
int left(int i){
  return 2*i;
}
int right(int i){
  return 2*i+1;
}

int i,A[500005],n;
int main(){
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&A[i]);
  }
  buildMaxHeap(A);
  for(i=1;i<=n;i++){
    printf(" %d",A[i]);
  }
  printf("\n");
  return 0;
}
void buildMaxHeap(int A[]){
  int i;
  for(i=n/2;i>=1;i--){
    maxHeapify(A,i);
  }
}
void maxHeapify(int A[],int i){
  int l,r,largest,tmp;
  l= left(i);
  r =right(i);
  if(l<=n && A[l]>A[i])largest =l;
  else largest =i;
  if(r<=n&&A[r]>A[largest])largest=r;
  if(largest != i){
    tmp=A[i];
    A[i]=A[largest];
    A[largest]=tmp;
    maxHeapify(A,largest);
  }
}

  

Measured memory_bytes: 2552
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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 = 1e9 + 7;

ll mod(ll a) {
	if (a > 0) return a % MOD;
	if (a % MOD == 0) return 0;
	ll x = -a / MOD + 1;
	a += x * MOD;
	return a % MOD;
}

template <typename T> void dump(T x) { cout << x << endl; }
void dumpf(double 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);
}
// int dx[4]    = {1, 0, -1, 0};
// int dy[4]    = {0, 1, 0, -1};
// ll pas[5001][5002];

int main() {
	IOS();
	ll n, k;
	cin >> n >> k;
	vector<ll> x, a(n), b(n);
	for (int i = 0; i < n; ++i) { cin >> a[i] >> b[i]; }
	x.push_back(k);
	ll tmp = 0;
	for (int i = 30; i >= 1; --i) {
		ll t = (1ll << i);
		if ((t & k) == t) {
			x.push_back(tmp + t - 1);
			tmp += t;
		}
	}
	int m  = x.size();
	ll ans = 0;
	for (int i = 0; i < m; ++i) {
		ll sum = 0;
		for (int j = 0; j < n; ++j) {
			bool ok = true;
			for (int k = 0; k < 30; ++k) {
				ll p = (1 << k) & a[j];
				ll q = (1 << k) & x[i];
				if (p > q) ok = false;
			}
			if (ok) sum += b[j];
		}
		ans = max(ans, sum);
	}
	dump(ans);
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#define loop(a,n) for(int i=a;i < n;i ++)

using namespace std;

int main()
{
	long long int n,T;
	cin >> n >> T;

	long long int t[n];

	long long int ans = 0;

	loop(0,n)
	{
		cin >> t[i];
	}

	loop(0,n)
	{
		if(t[i+1] - t[i] < T)
		{
			ans += t[i+1]-t[i];
		}
		else
		{
			ans += T;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 1792
use std::env;
use std::io::*;
use std::str::*;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let s = stdin.bytes().map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok().unwrap()
}

fn main() {
    // main の引数
    /*
        引数なしのときargs.len() = 1;
    */
    let args: Vec<String> = env::args().collect();

    let N = read::<String>();
    let N = N.chars().collect::<Vec<char>>();
    if N[0] == N[2] {
        println!("Yes");
    }else {
        println!("No");
    }
}


Measured memory_bytes: 4352
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return map(int,input().split())
def onem(): #Nとかの取得
	return int(input())
def s(x): #圧縮
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""

a,b = m()
print(a*b)



Measured memory_bytes: 65144
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
 
using namespace std;
 
typedef long long ll;
 
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define for1(i, n) for (int i = 1; i <= (int)n; i++)
#define forq(i, s, t) for (int i = s; i <= (int)t; i++)
#define ford(i, s, t) for (int i = s; i >= (int)t; i--)
#define all(v) v.begin(), v.end()
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
 
const double EPS = 1e-15;
const double PI = acos(-1.0);
const int MAXN = (int)1000 + 7;
const int INF = (int)1e9 + 7;
const int MOD = (int)1e9 + 7;
const ll P = 239017;
 
#define TASK "cave"
 
int solve();
 
int main()
{
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("test.txt", "w", stderr);
    double tstart = TIME;
#else
 //   freopen(TASK".in", "r", stdin), freopen(TASK".out", "w", stdout);
#endif
    solve();
#ifdef _DEBUG
    double tend = TIME;
    cerr << tend - tstart << " s.\n";
#endif
    return 0;
}
 
int cnt[(int)1e5 + 123];
 
int solve() {
 int n;
cin >> n;
for (int i = 0; i < n; i++) cin >> cnt[i];
 
int ans = 0;
for (int i = 0; i < n; i++){
if (cnt[i] == i + 1 && cnt[i + 1] == i + 2) ans++, i++;
else if (cnt[i] == i + 1) ans++;
}
cout << ans;
return 0;
 }

Measured memory_bytes: 640
#include <stdio.h>
int main(void){
    // Your code here!
    int time[3];
    int tmp;
    int i,j;
    scanf("%d %d %d",&time[0],&time[1],&time[2]);
    
    for(i=0;3>i;i++){
        for(j=i+1;3>j;j++){
            if(time[i]>time[j]){
                tmp = time[i];
                time[i] = time[j];
                time[j] = tmp;
            }
        }
    }
    
    printf("%d",time[0]+time[1]);
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//# define M_PI           3.1415926535
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll n,k;
	cin>>n>>k;
	ll a[n+2];
	for(ll i=0;i<n+1;i++)
		{
		a[i]=i;
		//cout<<i<<" ";
		    
		}
	ll b[n+2];
	
	for(ll i=0;i<n+1;i++)
		{
		
		b[i]=i;}
	ll m=1e9+7;

	for(ll i=1;i<n+1;i++)
		{
		a[i]=(a[i]+a[i-1]);
		
		//cout<<a[i]<<" ";
	}
	for(ll i=n-1;i>=0;i--)
		{
		b[i]+=b[i+1];
		
		}
	ll ans=0;
	ll i=k-1,j=n-k+1;
	while(j>=0)
	{
	//	cout<<"ih";
		//cout<<b[j]<<" "<<a[i]<<" ";
		ans=(ans%m+(b[j]%m-a[i]%m+m +1)%m)%m;
		i++;
		j--;
	}
	cout<<ans;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;
#define rep(i , j , n) for(long long i = j ; i <= n ; i++)
#define per(i , j , n) for(long long i = j ; i >= n ; i--)

const ll N = 123456;
const ll mod = 998244353;
const ld eps = 1e-5;

ll a[N];
ll b[N];
ll c[N];
int dp[4][N];
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cout.precision(10);

    int n;

    cin >> n;

    rep(i , 1 , n) cin >> a[i] >> b[i] >> c[i];

    dp[1][1] = a[1];
    dp[2][1] = b[1];
    dp[3][1] = c[1];
    rep(i , 2 , n) {
        dp[1][i] = a[i] + max(dp[2][i - 1] , dp[3][i - 1]);
        dp[2][i] = b[i] + max(dp[1][i - 1] , dp[3][i - 1]);
        dp[3][i] = c[i] + max(dp[1][i - 1] , dp[2][i - 1]);
    }

    cout << max(dp[1][n] , max(dp[2][n] , dp[3][n])) << endl;
    return 0;
}


Measured memory_bytes: 4224
S=list(input())

c1=0
c2=0

for i in range(len(S)):
    if i%2==0:
        if S[i]=='0':
            c1+=1
        else:
            c2+=1
    else:
        if S[i]=='1':
            c1+=1
        else:
            c2+=1

print(min(c1,c2))
    


Measured memory_bytes: 49508