akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"

// Begin {{{
using namespace std;

#define all(x) x.begin(), x.end()
#define rep(i, n) for (i64 i = 0; i < (n); ++i)
#define reps(i, s, n) for (i64 i = (s); i <= (n); ++i)
#define VAR(Type, ...) Type __VA_ARGS__; IN(__VA_ARGS__)

using i64 = int_fast64_t;
using pii = pair<i64, i64>;

template <class A, class B>
inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }

template <class A, class B>
inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;

// IN
void IN() {}
template <class Head, class... Tail>
void IN(Head&& head, Tail&&... tail) {
  cin >> head;
  IN(forward<Tail>(tail)...);
}

// OUTS
void OUTS() {}
template <class Head, class... Tail>
void OUTS(Head&& head, Tail&&... tail) {
  cout << head << " \n"[sizeof...(tail)==0];
  OUTS(forward<Tail>(tail)...);
}

template <class T>
void OUTS(vector<T> &vec) { for (auto &e : vec) cout << e << " \n"[&e==&vec.back()]; }

template <class T>
void OUTS(vector<vector<T>> &df) { for (auto &vec : df) OUTS(vec); }

// OUTL
void OUTL() {}
template <class Head, class... Tail>
void OUTL(Head&& head, Tail&&... tail) {
  cout << head << "\n";
  OUTL(forward<Tail>(tail)...);
}

template <class T>
void OUTL(vector<T> &vec) { for (auto &e : vec) cout << e << "\n"; }

// OUTN
void OUTN() {}
template <class Head, class... Tail>
void OUTN(Head&& head, Tail&&... tail) {
  cout << head;
  OUTN(forward<Tail>(tail)...);
}

template <class T>
void OUTN(vector<T> &vec) { for (auto &e : vec) cout << e; }
// }}} End

signed main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  VAR(int, N, A, B);
  int maxv = min(A, B);
  int minv = max(A + B - N, 0);
  OUTS(maxv, minv);
  return 0;
}


Measured memory_bytes: 256
/// Containers Start
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
/// C Header Files
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <math.h>
#include <stdio.h>
/// Containers End

using namespace std;

/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF (0x3f3f3f3f)
/// Math End

/// Extra Start
#define nn '\n'
#define pb push_back
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
/// Extra End

#define rep(i, n) for (int i = 0; i < n; i++)
#define Cini(a)                                                                \
    int a;                                                                     \
    cin >> a;
#define Cinii(a, b)                                                            \
    int a, b;                                                                  \
    cin >> a >> b;
#define Ciniii(a, b, c)                                                        \
    int a, b, c;                                                               \
    cin >> a >> b >> c;
#define Cins(s)                                                                \
    string s;                                                                  \
    cin >> s;
#define Cinss(s1, s2)                                                          \
    string s1, s2;                                                             \
    cin >> s1 >> s2;
#define Cinc(c)                                                                \
    char c;                                                                    \
    cin >> c;
/// Functions End


/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl;
#define deb3(x, y, z)                                                          \
    cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "   \
         << z << endl;
/// Debug End

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

/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/

/// template

#define int long long

signed main(void) {
    cin.sync_with_stdio(false);
    cin.tie(0);
    Cini(N);
    Cins(S);
    Cini(K);
    rep(i,N)if(S[i]!=S[K-1])S[i]='*';
    cout << S << nn;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
 
using namespace std;
 
int main() {
        int i;
    int n,m,h,h_sum;
    string s;
    
    while(1){
        cin >> s;
        //exit condition
        if(s=="-") break;
        
        n=s.size();
        cin >> m;
        h_sum=0;
        for(i=0;i<m;i++){
            cin >> h; 
            h_sum+=h;
        }
        h_sum%=n;
        cout << s.substr(h_sum)+s.substr(0,h_sum) << endl;
        
    }
    
        return 0;
}

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

#include <vector>
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
using namespace std;

int main() {
  string s, t;
  cin >> s >> t;
  int min = s.length();
  int tmp = 0;
  for (int i = 0; i < s.length() - t.length() + 1; i++) {
    tmp = 0;
    for (int j = 0; j < t.length(); j++) {
      if (s[i + j] != t[j]) {
        tmp++;
      }
    }
    if (tmp < min) {
      min = tmp;
    }
  }
  cout << min << endl;
}

Measured memory_bytes: 3540
#ifdef LOCAL111
#else
	#define NDEBUG
#endif
#include <bits/stdc++.h>
const long long INF = 1e18;
using namespace std;

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define RBP(i,a) for(auto& i : a)
#ifdef LOCAL111
	#define DEBUG(x) cout<<#x<<": "<<(x)<<endl
	template<typename T> void dpite(T a, T b){ for(T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite; cout << endl;}
#else
	#define DEBUG(x) true
	template<typename T> void dpite(T a, T b){ return; }
#endif
#define F first
#define S second
#define SNP string::npos
#define WRC(hoge) cout << "Case #" << (hoge)+1 << ": "
#define rangej(a,b,c) ((a) <= (c) and (c) < (b))
#define rrangej(b,c) rangej(0,b,c)
template<typename T> void pite(T a, T b){ for(T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite; cout << endl;}
template<typename T> bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;}
template<typename T> bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;}

typedef long long int LL;
typedef unsigned long long ULL;
typedef pair<int,int> P;
typedef pair<LL,LL> LP;

void ios_init(){
	//cout.setf(ios::fixed);
	//cout.precision(12);
#ifdef LOCAL111
	return;
#endif
	ios::sync_with_stdio(false); cin.tie(0);	
}

LL dp[100005][3];

int main()
{
	ios_init();
	int n;
	cin >> n;
	vector<LL> a(n);
	REP(i,n) cin >> a[i];
	dp[0][0] = 0;
	dp[0][1] = -INF;
	dp[0][2] = -INF;
	REP(i,n){
		REP(j,3){
			dp[i+1][j] = -INF;
			if(a[i] >= j){
				dp[i+1][j] = dp[i][0]+(a[i]-j)/2;
				if(j != 2 and a[i] >= j+1){
					chmax(dp[i+1][j],max(dp[i][1],dp[i][2])+(a[i]-j-1)/2+1);
				}
			}
		}
	}
	// REP(i,n){
	// 	REP(j,3){
	// 		cout << dp[i][j] << ' ' ;
	// 	}
	// 	cout << endl;
	// }
	cout << dp[n][0] << endl;
	return 0;
}


Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define pu push
#define pp pop_back
#define in insert
#define forn(low,high,i) for(i=low;i<high;i++)
#define forrev(high,low,i) for(i = high; i>= low;i--)                                 //g++ template.cpp -o template.exe
#define zeroes(x) memset(x,0,sizeof(x))                                        //all elements to 0  |  \
#define all(x) (x).begin(), (x).end()
typedef long long int ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
const ll mod =1e9+7;
const ll maxn=100000;
#define MAX 50 







bool sortbysec(const pair<int,int> &a,                         //sorting of elements wrt second
              const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
} 


void out(long long int n) 
{ 
    char str[MAX]; 
    long long int i = 0;  
  
    while (n > 0) { 
        
        long long int rem = n % 26; 
  
         
        if (rem == 0) { 
            str[i++] = 'z'; 
            n = (n / 26) - 1; 
        } 
        else 
        { 
            str[i++] = (rem - 1) + 'a'; 
            n = n / 26; 
        } 
    } 
    str[i] = '\0'; 
  
    
    reverse(str, str + strlen(str)); 
    cout << str << endl; 
  
    return; 
} 




int main()
{
	long long int n;
	cin>>n;
	out(n);

	return 0;
}

Measured memory_bytes: 3632
#include<iostream>

using namespace std;


int main(void){

  int a,b,c;
  int ans = -1;
  int t = 0;
  cin >> a >> b >> c;
  while(t< 10000){
    while(t > c) c+=60;
    if(t <= c && c <= t+a){
      ans = c;
      break;
    }
    t += a+b;
  }

  cout << ans << endl;

}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;

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

  int A,B;
  cin >> A >> B;

  if (A%3==0 || B%3==0 || (A+B)%3==0) {
    cout << "Possible" << endl;
  } else {
    cout << "Impossible" << endl;
  }
  return 0;
}


Measured memory_bytes: 3628
s = input()
a = "qwertyuiopasdfghjklzxcvbnm"
mi = 100
for i in a:
    ma,cnt = 0,0
    for j in s:
        if j != i:
            cnt += 1
        else:
            ma = max(ma, cnt)
            cnt = 0
        ma = max(ma,cnt)
    mi = min(mi,ma)
print(mi)

Measured memory_bytes: 8944
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	    int N = sc.nextInt();
	    int M = sc.nextInt();
	    
	    if (N<=5)
	    	System.out.println(0);
	    else if (N<=12)
	    	System.out.println(M/2);
	    else
	    	System.out.println(M);
	    
	    sc.close();

	}
	

}

Measured memory_bytes: 21204
#include <iostream>
#include <cmath>
#include <climits>
#include <cfloat>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef vector<PII> VPII;

#define REP( i, m, n ) for( int i = (int)( m ); i < (int)( n ); ++i )
#define FOR( v, c ) for( auto &v : c )
#define ALL( c ) (c).begin(), (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( a, b )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

PII expression( const string &, int );
PII numbers( const string &, int );

PII expression( const string &s, int p = 0 )
{
	if ( s[p] == '[' )
	{
		VI res;
		PII r = expression( s, p + 1 );
		res.PB( r.fst );
		r.snd ++; // skip ']'
		while ( s[ r.snd ] == '[' )
		{
			PII r_ = expression( s, r.snd + 1 );
			res.PB( r_.fst );
			r.snd = r_.snd + 1;
		}

		sort( ALL( res ) );
		int resvalue = accumulate( res.begin(), res.begin() + res.size() / 2 + 1, 0 );
		return MP( resvalue, r.snd );
	}
	else
	{
		return numbers( s, p );
	}		
}


PII numbers( const string &s, int p = 0 )
{
	int res = 0;
	while ( '0' <= s[p] && s[p] <= '9' )
	{
		res *= 10;
		res += s[ p++ ] - '0';
	}

	return MP( res / 2 + 1, p );
}


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

	REP( i, 0, n )
	{
		string line;
		cin >> line;

		cout << expression( line ).fst << endl;
	}

	return 0;
}

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

namespace ABC066A
{
	class Program
	{
		static void Main(string[] args)
		{
			int a, b, c, s;

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

			a = int.Parse(word[0]);
			b = int.Parse(word[1]);
			c = int.Parse(word[2]);

			int x = a + b;
			int y = b + c;
			int z = a + c;

			s = x;
			if (y < s) s = y;
			if (z < s) s = z;


			Console.WriteLine(s);

			//Console.ReadKey();
		}
	}
}

Measured memory_bytes: 27304
// Problem : C - Chocolate Bar
// Contest : AtCoder Regular Contest 074
// URL : https://atcoder.jp/contests/arc074/tasks/arc074_a
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define cerr if(1)cerr
#define size(x) (int)x.size()
#define all(x) x.begin(), x.end()

const int N = 1e6 + 1, mod = 1e9 + 7, inf = 2e9;

int h, w;

ll hor(int h, int w) {
	if (h == 2) {
		return inf;
	}
	if (h % 3 == 0) {
		return 0;
	}
	return w;
}

ll ver(int h, int w) {
	int ans = 0;
	for (int i = 16; i >= 0; i--) {
		ans += 1 << i;
		if (ans > h || 1ll * ans * w > 1ll * (h - ans) * (w / 2)) {
			ans -= 1 << i;
		}
	}
	ll res = inf;
	if (w & 1) {
		res = abs(1ll * ans * w - 1ll * (h - ans) * (w / 2 + 1));
	} else {
		res = abs(1ll * ans * w - 1ll * (h - ans) * (w / 2));
	}
	ans++;
	if (ans != h + 1) {
		res = min(res, abs(1ll * ans * w - 1ll * (h - ans) * (w / 2)));
	}
	return res;
}

int main() { cin.tie(0)->sync_with_stdio(0);
	cin >> h >> w;
	cout << min({hor(w, h), hor(h, w), ver(w, h), ver(h, w)});
}


Measured memory_bytes: 256
S = input()

for i in range(len(S)):
    if i % 2 == 0 and S[i] in ['R', 'U', 'D']:
        continue
    elif i % 2 == 1 and S[i] in ['L', 'U', 'D']:
        continue
    print('No')
    break
else:
    print('Yes')

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

int main(){
	int a,b,c;
	int ans;
	int cnt=0;
	
	while(cin>>a>>b){
		//-----test-----
		if(0<=a&& a<500) break;
		
		
		//--------------
		c=a+b;
		ans=1;
		while(10<=c){
			c/=10;
			ans++;
		}
		cout<<ans<<endl;
		cnt++;
	}
	
	return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int gcd(int a,int b)
{
	if(b==0)
	return a;
	
	return gcd(b,a%b);
}
int power(int x,int y,int p)
{
	int res=1;
	x=x%p;
	while(y>0)
	{
		if(y&1)
		res=(res*x)%p;
		
		y=y>>1;
		x=(x*x)%p;
	}
	return res;
}
int modInverse(int n,int p)
{
	return power(n,p-2,p);
}
int main() {
	// your code goes here
	 ios_base::sync_with_stdio(0);
	 cin.tie(0);
	 ll n;
	 cin>>n;
	 vector<ll> v(n);
	 map<ll,ll> mp;
	 for(ll i=0;i<n;i++)
	 {
		 ll x;
		 cin>>x;
		 mp[x]++;
	 }
	 ll s=0;
	 for(auto x:mp)
	 {
		 s+=(x.first*x.second);
	 }
	 ll q;
	 cin>>q;
	 while(q-->0)
	 {
		 ll b,val;
		 cin>>b>>val;
		 if(mp.count(b))
		 {
			 s=s-b*mp[b];
			 s=s+val*mp[b];
			 mp[val]+=mp[b];
			 mp.erase(b);
		 }
		 cout<<s<<'\n';
	 }
	 
}


Measured memory_bytes: 7888
#include<iostream>
#include<string>
#include <cstdlib>
#include <ctime>
using namespace std;
 
int main() {
  long long a,v,b,w,t;
  cin >> a >> v >> b >> w >> t;
  if(a >= b){
    if(t*(v-w) >= (a-b)){
      cout << "YES" << endl;
    }
    else{
      cout << "NO" << endl;
    }
  }
  else{
    if(t*(v-w) >= (b-a)){
      cout << "YES" << endl;
    }
    else{
      cout << "NO" << endl;
    }
  }
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define pd(x) printf("%d\n",x)
#define plld(x) printf("%lld\n",x)
#define pss printf
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#define endl '\n'
#define debug(n1) cout<<n1<<endl
const int N = 1e5;  // limit for array size
ll n;  // array size

/*template<typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l, int r){
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}
*/
int main(){
    string s;cin>>s;
    int ans=0;
    for(int i=0;i<s.length();i++){
    	if(s[i]=='?'){
    		s[i]='D';
		}
	}
	
	cout<<s<<endl;
	/*for(int i=0;i<s.length();i++){
    	if(s[i]=='D'){
    		ans++;
		}
		if(i!=s.length()-1&&s[i]=='P'&&s[i+1]=='D'){
			ans++;
		}
	}
	
	cout<<ans<<endl;*/
	return 0;
}



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

using namespace std;


void energy_drink_collector()
{
  int n, m;
  cin >> n >> m;
  vector<pair<int,int>> ab(n);
  for (int i = 0; i < n; ++i) cin >> ab[i].first >> ab[i].second;

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

  long long int total_fee = 0;
  for (int i = 0; i < n && m > 0; ++i)
  {
    total_fee += (long long int)ab[i].first * (long long int)min(m, ab[i].second);
    m -= min(m, ab[i].second);
  }

  cout << total_fee << "\n";
}


void get_AC()
{
  int n, q;
  string S;
  cin >> n >> q >> S;

  vector<int> cnt(n + 1);
  for (int i = 0; i < n; ++i)
  {
    if (i + 1 < n && S[i] == 'A' && S[i + 1] == 'C') cnt[i + 1] = cnt[i] + 1;
    else cnt[i + 1] = cnt[i];
  }

  for (int i = 0; i < q; ++i)
  {
    int l, r;
    cin >> l >> r;
    cout << cnt[r - 1] - cnt[l - 1] << "\n";
  }
}


void five_transportations()
{
  long long int n;
  cin >> n;
  long long int v_min = 1000000000000000, tmp;
  for (int i = 0; i < 5; ++i) 
  {
    cin >> tmp;
    v_min = min(v_min, tmp);
  }

  cout << (n - 1)/ v_min + 5;
}


void coloring_colorfully()
{
  string s;
  cin >> s;

  int cnt_01 = 0, cnt_10 = 0;
  for (int i = 0; i < s.size(); ++i)
  {
    if (i % 2 == 0)
    {
      if (s[i] != '0') ++cnt_01;
      else ++cnt_10;
    }
    else
    {
      if (s[i] != '1') ++cnt_01;
      else ++cnt_10;
    }
  }

  cout << min(cnt_01, cnt_10) << "\n";
}


int main()
{
  //energy_drink_collector();
  //get_AC();
  //five_transportations();
  coloring_colorfully();
}


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

using namespace std;

typedef long long int ll;

int main(){
	
	ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
	
   	string str;
   	
   	cin >> str;
   	
   	int len = str.size();
   	int arr[30] = {0};
   	for(int i = 0; i < len; i++){
   		arr[str[i] - 'a']++;	
	}
	
	for(int i = 0; i < 26; i++){
		if(arr[i] % 2 != 0){
			cout << "No" << endl;
			return 0;
		}
	}
	
	cout << "Yes" << endl;
   
    return 0;
}

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


Measured memory_bytes: 1940
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n,c,k=map(int,input().split())
    ans=0
    person=0
    wait=-10**9
    T=[int(input())for _ in range(n)]
    T.sort()
    for i in range(n):
        if T[i]-wait<=k and person+1<=c:
            person+=1
        else:
            ans+=1
            person=1
            wait=T[i]
    print(ans)

if __name__=='__main__':
    main()

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

signed main(){
	int A, B;
	char op;
	cin >> A >> op >> B;
	if(op == '+'){
		printf("%d\n", A + B);
	}
	else{
		printf("%d\n", A - B);
	}
	return 0;
}

Measured memory_bytes: 3740
#include<bits/stdc++.h>
using namespace std;
 
#define pii pair<int,int>
#define pll pair<ll,ll>
#define eb emplace_back
#define ll long long
#define nl '\n'
#define in() ( { int a ; scanf("%d",&a); a; } )
 
const int N = 3e5 + 9;
const int mod = 1e9 + 7;
//int dx[]={1,0,-1,0,1,-1,-1,1};
//int dy[]={0,1,0,-1,1,1,-1,-1};

ll sum[1][13];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    ll n, m, x, i, j, k, l, cnt = 0;
    cin >> n >> m >> x;
    ll ar[n][m+1], cost[n], ans = 0;
    vector<ll>res;
    for(i = 0; i < n; i++){
        cin >> cost[i];
        for(j = 0; j < m; j++){
            cin >> ar[i][j];
        }
    }
    
    for(i = 0; i < (1 << n); i++){
        vector<ll>v;
        memset(sum, 0, sizeof(sum));
        ans = 0;
        cnt = 0;
        for(j = 0; j < n; j++){
            if(i&(1<<j)){
                v.eb(j);
            }
        }
        for(j = 0; j < v.size(); j++){
            ans += cost[v[j]];
            for(k = 0; k < m; k++){
                sum[0][k] += ar[v[j]][k];
            }
        }
        for(j = 0; j < m; j++){
            if(sum[0][j] >= x){
                cnt++;
            }
        }
        if(cnt == m){
            res.eb(ans);
        }
    }
    if(res.empty()){
        cout << -1 << endl;
        return 0;
    }
    sort(res.begin(), res.end());
    cout << res[0] << endl;
    
}

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

int tax(int price, int rate) {
    return price * (100 + rate) / 100;
}

int main() {
    int x, y, s;
    while(cin >> x >> y >> s, x | y | s) {
        int answer = 0;
        for(int i = 1; i < 1000; ++i) for(int j = 1; j < 1000; ++j) {
            if(tax(i, x) + tax(j, x) == s) answer = max(answer, tax(i, y) + tax(j, y));
        }
        cout << answer << endl;
    }
}

Measured memory_bytes: 1160
N = int(input())
R = []
for _ in range(N):
    X, L = map(int, input().split())
    R.append([X-L, X+L])

R = sorted(R, key=lambda x: x[1])

ans = 1
p = R[0][1]
for i in range(1, N):
    if p <= R[i][0]:
        ans += 1
        p = R[i][1]

print(ans)


Measured memory_bytes: 22104
#include <bits/stdc++.h>
using namespace std;
int main() {

  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  if(s == "SUN")
    cout << 7;
  else if(s == "MON")
    cout << 6;
  else if(s == "TUE")
    cout << 5;
  else if(s == "WED")
    cout << 4;
  else if(s == "THU")
    cout << 3;
  else if(s == "FRI")
    cout << 2;
  else
    cout << 1;
  return 0;

}

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

#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);i++)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;i>=(int)(m);i--)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
//constexpr long long MOD = (ll) 1e9 + 7;
constexpr long long MOD = 998244353LL;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


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

struct Edge {
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
	to = _to; cap = _cap; rev = _rev;
	}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

class UnionFind {
 vector<int> data;
 int num;
public:
 UnionFind(int size) : data(size, -1), num(size) { }
 bool unionSet(int x, int y) {
  x = root(x); y = root(y);
  if (x != y) {
   if (data[y] < data[x]) swap(x, y);
   data[x] += data[y]; data[y] = x;
   num--;
  }
  return x != y;
 }
 bool findSet(int x, int y) {
  return root(x) == root(y);
 }
 int root(int x) {
  return data[x] < 0 ? x : data[x] = root(data[x]);
 }
 int size(int x) {
  return -data[root(x)];
 }
 int numSet() {
  return num;
 }
};

void solve(){
    ll n,c;
    cin>>n>>c;
    Array x(n+2,0),v(n+1,0);
    x[n+1]=c;
    REP(i,n){
        cin>>x[i+1]>>v[i+1];
    }

    Array sumr(n+1,0),suml(n+1,0);
    REP(i,n){
        sumr[i+1] = sumr[i]+v[i+1]-x[i+1]+x[i];
        suml[i+1] = suml[i]+v[n-i]-x[n-i+1]+x[n-i];
    }

    Array maxr(n+1,0),maxl(n+1,0);
    rep(i,1,n+1){
        maxr[i] = max(maxr[i-1],sumr[i]);
        maxl[i] = max(maxl[i-1],suml[i]);
    }
    cout<<en;

    ll ans=max(maxr[n],maxl[n]);

    REP(i,n){
        //引き返すパターン
        chmax(ans,sumr[i+1]-x[i+1]+maxl[n-i-1]);
        chmax(ans,suml[i+1]-c+x[n-i]+maxr[n-i-1]);
    }
    cout<<ans<<en;
}

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

    solve();
    //ll t;cin>>t;REP(i,t) solve();

    return 0;
}

Measured memory_bytes: 4992
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int N, M, H[int(1e5 + 5)];
bool checked[int(1e5 + 5)];

int main(){
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++) scanf("%d", H + i);

  for (int i = 0; i < M; i++){
    int A, B; scanf("%d%d", &A, &B);
    if (H[A] > H[B]){
      checked[B] = true;
    }else if (H[A] < H[B]){
      checked[A] = true;
    }else{
      checked[A] = true; checked[B] = true;
    }
  }

  int ans = 0;
  for (int i = 1; i <= N; i++){
    if (!checked[i]) ans++;
  }
  cout << ans << endl;

  return 0;
}


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

using namespace std;

#define fore(i, s, e) for(int i = s; i < e; i++)
#define FIN ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define fst first
#define snd second

typedef long long ll;

set<ll>::iterator pr(set<ll>::iterator &it, set<ll> &a) {
    if(it == a.begin()) return it;
    else return prev(it);
}

ll getD(set<ll>::iterator &it1, set<ll>::iterator &it2, ll x) {
    return min(abs(x - *it1) + abs(*it1 - *it2), abs(x - *it2) + abs(*it1 - *it2));
}

int main() {
    ll A, B, Q; cin >> A >> B >> Q;
    set<ll> s, t;
    fore(i, 0, A) {
        ll a; cin >> a; s.insert(a);
    }
    fore(i, 0, B) {
        ll b; cin >> b; t.insert(b);
    }
    fore(i, 0, Q) {
        ll x; cin >> x;

        auto ls = s.lower_bound(x);
        auto lt = t.lower_bound(x);
        if(ls == s.end()) ls--;
        if(lt == t.end()) lt--;
        auto ps = pr(ls, s);
        auto pt = pr(lt, t);

        ll d = min({getD(ls, lt, x), getD(ls, pt, x), getD(ps, lt, x), getD(ps, pt, x)});

        cout << d << endl;
    }
    return 0;
}

Measured memory_bytes: 10752
#include <stdio.h>
#define N 100

int main(){
  int i, j, n, tmp, arr[N], flag = 1, count = 0;

  scanf("%d", &n);

  for(i = 0; i < n; i++){
    scanf("%d", &arr[i]);
  }

  while(flag){
    flag = 0;
    for(i = n - 1; i > 0; i--){
      if(arr[i] < arr[i - 1]){
	tmp = arr[i];
	arr[i] = arr[i - 1];
	arr[i - 1] = tmp;
	flag = 1;
	count++;
      }
    }
  }

  for(i = 0; i < n - 1; i++){
    printf("%d ", arr[i]);
  }
  printf("%d\n%d\n", arr[i], count);

  return 0;
}  

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
const int N = 2000 + 5;

int arr[N];
bitset<4000000+5> dp;

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n, sum = 0; cin >> n;
	for(int i=0;i<n;i++){
		cin >> arr[i];
		sum += arr[i];
	}
	dp[0] = 1;
	for(int i=0;i<n;i++) dp |= dp<<arr[i];
	for(int i=(sum+1)/2;i<=sum;i++) if(dp[i]){
		cout << i << '\n';
		break;
	}
	return 0;
}

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

int gcd(int a, int b) {
	if (b)
		return gcd(b, a%b);
	return a;
}
int main() {
	int n,X;
	cin>>n>>X;
	int a[100010];
	for (int i=0; i<n; i++) {
		int pos; cin>>pos;
		a[i] = pos-X;
	}
	a[n++] = 0;
	sort(a, a+n);
	int ans = a[1]-a[0];
	for (int i=2; i<n; i++) 
		if (a[i]-a[i-1] != 0){
			ans = gcd(ans, a[i]-a[i-1]);
		}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 640
//by azidoazideazide(c2n14)
#include<iostream>
#include<string>
#include<cmath>
#include<algorithm> //#include<map>
#include<vector>
using namespace std;
typedef long long ll;
//#include<fstream>
//ifstream fin("rps.in");
//ofstream fout("rps.out");
//#define pb push_back
int cd(int n){
  int ans=0;
  while(n>0){
    n/=10,ans++;
  }
  return ans;
}
int main(){
	ios::sync_with_stdio(0);
	int a,b;
  while(cin>>a>>b){
      cout<<cd(a+b)<<"\n";   
  }
return 0;
}


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

int main() {
  int A[100010];
  int n, S;
  cin >> n >> S;
  for (int i; cin >> A[i]; ++i) {
  }
  int m = 100010;
  for (int f = 0, b = 0, s = 0; f < n; ++f) {
    s += A[f];
    while (s >= S + A[b])
      s -= A[b++];
    if (s >= S)
      m = min(m, f - b + 1);
  }
  cout << (m > 100000 ? 0 : m) << endl;
}


Measured memory_bytes: 3476
{-# LANGUAGE OverloadedLists     #-}
{-# LANGUAGE OverloadedStrings   #-}
{-# LANGUAGE ScopedTypeVariables #-}

import           Control.Monad
--import           Control.Monad.Loops
import           Data.IORef
import           Data.Maybe
import qualified Data.Text     as T
import qualified Data.Text.IO  as T
import           GHC.Base
import           System.IO

import qualified Data.Array    as A
import qualified Data.IntMap   as I
import           Data.List
import qualified Data.Map      as M
import qualified Data.Set      as S
import qualified Data.Vector   as V

-- for Text
(+.+) = T.append
(!.!) = T.index

-- for Vector
count :: (a -> Bool) -> V.Vector a -> Int
count p = V.length . V.filter p

-- for IO
readT :: Read a => T.Text -> a
readT = read . T.unpack

getLineSpc :: Read a => IO [a]
getLineSpc = do
  t <- T.getLine
  let xs = map readT $ T.split (== ' ') t
  return xs

getLineSpcVec :: Read a => IO (V.Vector a)
getLineSpcVec = do
  t <- T.getLine
  let xs = V.fromList $ map readT $ T.split (== ' ') t
  return xs

----------
-- main --
----------
main :: IO ()
main = kagamiMochi

kagamiMochi :: IO ()
kagamiMochi = do
  n  :: Int   <- readLn
  ds :: [Int] <- replicateM n readLn
  print $ length $ nub ds

Measured memory_bytes: 1020
#include<iostream>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>//setprecision
#include<math.h>
#include <functional>
#include<climits>
using namespace std;
#define ll  long long 
#define rep(i, n)        for(ll i=0; i<(ll)(n); ++i)
#define mod 1000000007
  vector<ll>to[1000005];
   ll dp[2000000];
 int gcd(int a, int b)
{
  if (a%b == 0)
{
return(b);
}
else
{
return(gcd(b,a%b));
}
}
int main(){
  ll a,b,c=0,d=0;cin>>a;
  rep(i,a){
    cin>>b;
    d+=abs(c-b);
    c=b;
  }
  d+=b;
  cout<<d/2;
}



Measured memory_bytes: 27064
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	int n; cin >> n;
	int ans = 0, con = 0;
	rep(i, n){
		int a; cin >> a;
		if(a - 1 == i) con++;
		else{
			ans += (con + 1) / 2;
			con = 0;
		}
	}
	ans += (con + 1) / 2;
	cout << ans << endl;
	return 0;
}

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

typedef long long lint;
typedef long double ldouble;
#define REP(i, x, n) for(int i = x ; i < n ; i++)
#define rep(i, n) REP(i, 0, n)
#define repr(i, n) for(int i = n - 1 ; i >= 0 ; i--)
#define SORT(c) sort((c).begin(), (c).end())

const int IINF = 1e9 + 10;
const lint LLINF = (lint)1e18 + 10;
const lint MOD = (lint)1e9 + 7;
const lint inv = MOD - 2;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};

const int MAX_N = (int)1e5 + 10;
vector<bool> isPrime(MAX_N, true);

void eratosthenes(int N){
    rep(i, 2){
        isPrime[i] = false;
    }
    for(int i = 2 ; i * i <= N ; i++){
        if(isPrime[i]){
            for(int j = 2 ; i * j <= N ; j++){
                isPrime[i*j] = false;
            }
        }
    }
    return;
}

int main(){
    eratosthenes(1e5);
    vector<int> sum(MAX_N);
    sum[0] = 0;
    REP(i, 1, MAX_N){
        if(isPrime[i] && isPrime[(i+1)/2]){
            sum[i] = 1;
        }
        sum[i] += sum[i-1];
    }
    int q;
    cin >> q;
    rep(i, q){
        int l, r;
        cin >> l >> r;
        cout << sum[r] - sum[l-1] << endl;
    }
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
using namespace std;
using vi = vector<int>;
using vll = vector<long long int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long int>>;
using ll = long long int;

ll tt(ll N, ll a, ll b, const vll &C, const vll &S, const vll &F){
    if(a == N-1){
        return b;
    }else{
        ll t = b;
        if(t >= S[a]){
            ll m = t % F[a];
            if(m == 0){
                tt(N, a+1, b+C[a], C, S, F);
            }else{
                tt(N, a+1, b+(F[a]-m)+C[a], C, S, F);
            }
        }else{
            tt(N, a+1, S[a]+C[a], C, S, F);
        }
    }
}

int main(){
    ll N; cin >> N;
    vll C(N-1), S(N-1), F(N-1);
    for(int i=0; i<N-1; i++){
        cin >> C[i] >> S[i] >> F[i];
    }
    for(int i=0; i<N; i++){
        cout << tt(N, i, 0, C, S, F) << endl;
    }
}

Measured memory_bytes: 256
package main

import (
    "fmt"
    "sort"
    "strings"
)

func main() {
    
	var n, l int
	fmt.Scanf("%d %d",&n, &l)
	
	s := make([]string, n)
	for i := 0; i < n; i++ {
	    fmt.Scan(&s[i])
	}
	
	sort.Strings(s)
	
	fmt.Print(strings.Join(s, ""))
	fmt.Println()
	
}

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

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n;
    cin>>n;
    int ans = 0;
    int x;
    int mi = 1e8;
    for(int i=0;i<n;++i)
    {
        cin>>x;
        if(x<mi)
        {
            ans++;
            mi=x;
        }
    }
    cout<<ans;
}


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

using namespace std;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);

  string s;
  cin >> s;
  if (s.back() == 's') s += "es";
  else s += 's';
  cout << s;

  return 0;
}


Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std; 
int main() {
  int N;
  int K;
  int i=0;
  cin>>N>>K;
  int sum=1;
  while(i<N){
    if(sum>=K){
      sum+=K;
    }else{
      sum*=2;
    }
    i++;
  }
  cout<<sum<<endl;
}


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

#define ull unsigned long long
#define endl '\n'
#define ll long long
const int N = 1e5 + 5;
ll dp[N];
ll mod = 1e9 + 7;
vector<ll> node[N];
ll ans = 1, k;
void dfs(ll u, ll p){
        ans *= max(0ll, k - dp[p]);
        ans %= mod;
        if (p != 0) dp[u] = 2;
        else dp[u] = 1;
        for (auto j : node[u]){
                if (j != p) {
                        dfs(j, u);
                        dp[u]++;
                }
        }
}
int main(){
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
        if (fopen(".INP", "r")){
                freopen(".INP", "r", stdin);
                freopen(".OUT", "w", stdout);
        }
        ll n;
        cin >> n >> k;
        for (int i = 1; i < n; i++){
                ll u, v;
                cin >> u >> v;
                node[u].push_back(v);
                node[v].push_back(u);
        }
        dfs(1, 0);
        cout << ans;
}


Measured memory_bytes: 9984
N, M = map(int, input().split())
A = [0]*N
B = [0]*N
C = [0]*M
D = [0]*M
for i in range(N):
    A[i], B[i] = map(int, input().split())
for i in range(M):
    C[i], D[i] = map(int, input().split())
    
def Main(N, M, A, B, C, D):
    ans = []
    for i in range(N):
        min_dist = 10**9
        min_ind = 1
        for j in range(M):
            dist = abs(A[i]-C[j])+abs(B[i]-D[j])
            if min_dist > dist:
                min_dist = dist
                min_ind = j+1
        ans.append(min_ind)
    return ans
    
res = Main(N, M, A, B, C, D)
for e in res:
    print(e)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define what_is(x) cerr << #x <<" is " << x << endl;
typedef long long ll;
const int MOD = 998244353;
const double PI = 3.141592653589793;
const ll INF =  1e18 + 7;
const int nax = 200005;


double power(double a, ll b) {
	double ans = 1;
	while (b) {
		if (b & 1) {
			ans = (ans * a);
		}
		a = (a * a);
		b = b >> 1;
	}
	return ans;
}


int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int tc = 1;
	// cin >> tc;
	while (tc--) {
		int n,k;
		cin >> n >> k;
		vector<bool > vis(n+1,false);
		for(int i=1;i<=k;i++){
			int d;
			cin >> d;
			for(int j=1;j<=d;j++){
				int x;
				cin >> x;
				vis[x] = true;
			}
		}
		int ans = 0;
		for(int i=1;i<=n;i++){
			if(!vis[i]){
				ans++;
			}
		}
		cout<<ans;
	}
	return 0;
}




















Measured memory_bytes: 3656
N = int(input())
As = list(map(int, input().split()))

sumA = sum(As)
sumOdd = sum(As[::2])

B = 2*sumOdd - sumA
Bs = [B]
for A in As[:-1]:
    B = 2*A - B
    Bs.append(B)

print(' '.join(map(str, Bs)))


Measured memory_bytes: 19148
#include <bits/stdc++.h>
#define arep(a,i,n) for(ll i=(a);i<(n);i++)
#define rep(i,n) for(ll i=0;i<(n);i++)
#define cinf(x,n) for(ll i=0;i<(n);i++)cin>>x[i];
#define coutf(x,n) for(ll i=0;i<(n);i++)cout<<x[i]<<endl;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

using namespace std;

int main(){
	char c;
	cin >> c;
	set<char> v = {'a','e','i','o','u'};
	if(v.count(c))
		cout << "vowel" << endl;
	else
		cout << "consonant" << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
const int mod = 1e9 + 7;
const int maxn = 200105;

int n, m;
vector<int>g[maxn];
ll dp[maxn];
ll ans[maxn];
vector<ll>pre[maxn];
vector<ll>suf[maxn];
void dfs(int now, int p) {
	vector<int>ch;
	for (auto &i : g[now]) {
		if (i ^ p) {
			dfs(i, now);
			ch.pb((dp[i] + 1) % m);
		}
	}
	pre[now].pb(1);
	for (auto &i : ch) {
		pre[now].pb(pre[now].back() * i % m);
	}
	suf[now].pb(1);
	for (int i = ch.size() - 1 ; i >= 0 ; i--) {
		suf[now].pb(suf[now].back() * ch[i] % m);
	}
	dp[now] = pre[now].back();
} 
void dfs2(int now, int p, int pass) {
	int ptr = 0;
	int tot = pre[now].size() - 1;
	ans[now] = dp[now] * pass % m;
	for (auto &i : g[now]) {
		if (i ^ p) {
			ll pass2 = (pass * pre[now][ptr] % m * suf[now][tot - ptr - 1] % m + 1) % m;
			dfs2(i, now, pass2);
			ptr++;
		}
	}
}
void go() {
	cin >> n >> m;
	f(n - 1) {
		int x, y;
		cin >> x >> y;
		g[x].pb(y);
		g[y].pb(x);
	}
	dfs(1, 0);
	ans[1] = dp[1];
	dfs2(1, 0, 1);
	f1(n) {
		cout << ans[i] << '\n';
	}
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int c = 0;
    int t;
    if (!c) {
        t = 1;
    }
    else {
        cin >> t;
    }
    while (t--) {
        go();
    }
    
}

Measured memory_bytes: 36620
//header{{{
#include<bits/stdc++.h>
  
using namespace std;
 
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define Fixed fixed << setprecision(12)
#define int int64_t
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = 1e9+7; 
constexpr int MOD = 998244353;

template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

template <class T> using min_heap = priority_queue<T,vector<T>,greater<T> >;
template <class T> using max_heap = priority_queue<T>;
template <class A, class B> using umap = unordered_map<A,B>;
  
int gcd(int a,int b){ return b ? gcd(b,a % b) : a;}
int lcm(int a,int b){ return a / gcd(a,b) * b;}

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

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

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

    string s = to_string(a),t = to_string(b);
    string c,d;

    rep(i,a){
        c += t;
    }
    rep(i,b){
        d += s;
    }
        
    cout << min(c,d) << '\n';

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define pp pair<ll,ll>
#define vi vector<pair<pp,pp> >
#define pq_min priority_queue<ll,vector<ll>,greater<ll>>
#define pq_max priority_queue<ll>
#define forx(i,a,b) for(ll i=0;i<a;i++)
#define ld long double
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef pair<pp,pp> ppll;
const ll mod=1e9 + 7;
vector<string> ans;


ll findCeil (string str,char first,ll l,ll h)  
{  
    // initialize index of ceiling element  
    ll ceilIndex = l;  
  
    // Now iterate through rest of the elements and find  
    // the smallest character greater than 'first'  
    for (ll i = l+1; i <= h; i++)  
    if (str[i] > first && str[i] < str[ceilIndex])  
            ceilIndex = i;  
  
    return ceilIndex;  
}  

string reverse(string str, ll l, ll h)  
{  
    while (l < h)  
    {  
        swap(str[l], str[h]);  
        l++;  
        h--;  
    } 
    return str; 
}  
  
// Print all permutations of str in sorted order  
void sortedPermutations (string str)  
{  
    // Get size of string  
    ll size = str.length();  
    // Print permutations one by one  
    bool isFinished = false;  
    while ( ! isFinished )  
    {  
        // print this permutation  
         ans.pb(str);
  
        // Find the rightmost character which 
        // is smaller than its next character. 
        // Let us call it 'first char'  
        ll i;  
        for ( i = size - 2; i >= 0; --i )  
        if (str[i] < str[i+1])  
            break;  
  
        // If there is no such character, all  
        // are sorted in decreasing order,  
        // means we just printed the last 
        // permutation and we are done.  
        if ( i == -1 )  
            isFinished = true;  
        else
        {  
            // Find the ceil of 'first char' in  
            // right of first character.  
            // Ceil of a character is the  
            // smallest character greater than it  
            ll ceilIndex = findCeil( str, str[i], i + 1, size - 1 );  
  
            // Swap first and second characters  
            swap(str[i],str[ceilIndex] );  
  
            // reverse the string on right of 'first char'  
            str = reverse(str,i + 1,size-1);  
        }  
    }  
} 

int main()
{
	fast;
    ll n;
    cin>>n;
    string a="",b="";
    vector<string> str(9);
    str[1]="1";
    str[2]="12";
    str[3]="123";
    str[4]="1234";
    str[5]="12345";
    str[6]="123456";
    str[7]="1234567";
    str[8]="12345678";
    sortedPermutations(str[n]); 
    for(ll i=0;i<n;i++)
    {
    	char x;
    	cin>>x;
        a += string(1,x);
    }
    for(ll i=0;i<n;i++)
    {
    	char x;
    	cin>>x;
        b += string(1,x);
    }
    ll x,y;
    for(ll i=0;i<ans.size();i++)
    {
    	//cout<<ans[i]<<endl;
         if(a==ans[i])
         {
         	x=i;
         }
         if(b==ans[i])
         {
         	y=i;
         }
    }
    cout<<abs(y-x);
}

Measured memory_bytes: 2424
//by xiqiao
#include<bits/stdc++.h>
#define maxn 300005
using namespace std;
typedef long long ll;
int n;
int a[maxn];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=3*n;i++)scanf("%d",&a[i]);
	sort(a+1,a+3*n+1);
	ll res=0;
	for(int i=n+1;i<=3*n;i+=2)res+=a[i];
	cout<<res<<endl;
	return 0;
}

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

#define M 1000000007
#define MM 998244353 
#define ll long long 
#define pb push_back
#define mem0(a) memset(a,0,sizeof(a))
#define mem1(a) memset(a,-1,sizeof(a))
#define memf(a) memset(a,false,sizeof(a))
#define all(v) v.begin(),v.end()
#define sz(a) (ll)a.size()
#define F first
#define S second
#define INF 2000000000000000000
#define endl "\n"
#define _time_ 1.0 * clock() / CLOCKS_PER_SEC
#define popcount(x) __builtin_popcountll(x)
#define pll pair<ll,ll> 
#define ld long double

const long double PI = acos(-1);

ll power(ll b,ll e,ll m)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b%m,e/2,m)%m;
    return power(b*b%m,e/2,m);
}
ll power( ll b, ll e)
{
    if(e==0) return 1;
    if(e&1) return b*power(b*b,e/2);
    return power(b*b,e/2);
}
template<typename T, typename U> static inline void amin(T &x, U y){ if(y<x) x=y; }
template<typename T, typename U> static inline void amax(T &x, U y){ if(x<y) x=y; }
template<typename T, typename U> ostream& operator<<(ostream &os, const pair<T, U> &p)
{ 
    return os<<'('<<p.F<< ","<<p.S<<')'; 
}

int _runtimeTerror_()
{
    string s,t;
    cin>>s>>t;
    int ans=0;
    int n=sz(s);
    for(int i=0;i<n;++i)
        ans+=(s[i]!=t[i]);
    cout<<ans;
    return 0;
}

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #ifdef runSieve
        sieve();
    #endif
    #ifdef NCR
        initialize();
    #endif
    int TESTS=1;
    //cin>>TESTS;
    while(TESTS--)
        _runtimeTerror_();
    return 0;
}

Measured memory_bytes: 3796
L, R = map(int, input().split())
mod = 2019

mod_L = L % mod
mod_R = R % mod

if mod_L >= mod_R:
    print(0)
    exit()

if mod_R - mod_L < R - L:
    print(0)
else:
    ans = False
    for i in range(mod_R - mod_L):
        for j in range(i + 1, mod_R - mod_L + 1):
            if ans is not False:
                ans = min(ans, (mod_L + i) * (mod_L + j) % mod)
            else:
                ans = (mod_L + i) * (mod_L + j) % mod
    print(ans)

Measured memory_bytes: 3064