akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define re register
#define gc getchar
#define pc putchar
#define cs const
#define st static

inline
ll getint(){
	re ll num=0;
	re char c=gc();
	while(!isdigit(c))c=gc();
	while(isdigit(c))num=(num<<1)+(num<<3)+(c^48),c=gc();
	return num;
}

inline
void outint(ll a){
	st char ch[23];
	if(a==0)pc('0');
	while(a)ch[++ch[0]]=(a-a/10*10)^48,a/=10;
	while(ch[0])pc(ch[ch[0]--]);
}

inline
ll gcd(cs ll &a,cs ll &b){
	return b?gcd(b,a-a/b*b):a;
}

int N;
int K; 

int main(){
	N=getint();
	K=getint();
	if(K&1){
		ll tmp=(N/K);
		cout<<tmp*tmp*tmp;
	}
	else{
		ll tmp=(N/K);
		ll tmp2=tmp;
		if(N%K>=K/2)tmp2++;
		cout<<tmp*tmp*tmp+tmp2*tmp2*tmp2;
	}
	return 0;
} 

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int a, b,c;
	int sum;
	
	scanf("%d%d%d", &a, &b, &sum);
	for (int i = 0; i < 10; i++) {
		sum = sum * a - b;
		
		printf("%d\n", sum);
	}
	
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
using namespace std;
#include <stdio.h>
int main()
{
long long int a[100][100],b[100][100],c[100][100]={0};
int n,m,l,i,j,k;
cin>>n>>m>>l;
for(i=0;i<n;i++)for(j=0;j<m;j++)cin>>a[i][j];
for(i=0;i<m;i++)for(j=0;j<l;j++)cin >> b[i][j];
for(i=0;i<n;i++)for(j=0;j<l;j++)for (k=0;k<m;k++)c[i][j]+=a[i][k]*b[k][j];
for(i=0;i<n;i++){for(j=0;j<l;j++){
if (j)cout<<' ';
cout<<c[i][j]; 
}
cout<<endl;
}
}

Measured memory_bytes: 3296
K = int(input())
mod = 7 % K
if mod == 0:
    print(1)
    quit()

s = set()
s.add(mod)
ans = 1
while mod != 0:
    mod = (mod*10 + 7) % K
    ans += 1
    if mod in s:
        print(-1)
        quit()
    s.add(mod)

print(ans)

Measured memory_bytes: 77968
object Main{
  def gcd(x: Int, y: Int): Int =
    if(y > 0) gcd(y, x%y)
    else x

  def main(args:Array[String]) = {
    val tmp = scala.io.StdIn.readLine.split(" ").map(_.toInt).toList
    val list = scala.io.StdIn.readLine.split(" ").map(_.toInt).toList
    var g: Int = 0
    for(s <- list){
      g = gcd(g, s)
    }
    if(tmp(1) % g == 0 && list.max >= tmp(1))
      println("POSSIBLE")
    else
      println("IMPOSSIBLE")
  }
}

Measured memory_bytes: 49008
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for (int (i) = 1; (i) <= (n); (i++))
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define yn {puts("Yes");}else {puts("No");}
#define print(x) cout << (x) << endl;
#define printa(x, n) for(ll i = 0; i < n; i++) {cout << (x[i]) << " ";} cout << endl;
#define printd(x) printf("%.12f\n", ans);
#define Yes() cout << "Yes" << endl;
#define No() cout << "No" << endl;
#define YES() cout << "YES" << endl;
#define NO() cout << "NO" << endl;
template<class T> bool chmin(T& a, const T& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> bool chmax(T& a, const T& b) {if (a < b) {a = b; return 1;} return 0;}
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;

int main(void) {
    ll n, k;
    cin >> n >> k;
    vl a(n), f(n);
    rep (i, n) cin >> a[i];
    rep (i, n) cin >> f[i];

    sort(rng(a));
    sort(rrng(f));

    vector<pair<ll, pll>> hozon;
    rep (i, n) {
        hozon.push_back(make_pair(a[i] * f[i], make_pair(a[i], f[i])));
    }

    sort(rng(hozon));
    
    ll left = -1, right = 1e12 + 1, mid;
    while (left + 1 < right) {
        mid = (left + right) / 2;
        ll used = 0;
        rep (i, n) {
            if (hozon[i].fi > mid) {
                used += hozon[i].se.fi - (mid / hozon[i].se.se);
              
            }
        }
        if (used > k) left = mid;
        else right = mid;
        //print(mid)
    }

    ll used = 0;
    rep (i, n) {
        if (hozon[i].fi > mid) {
            used += hozon[i].se.fi - (mid / hozon[i].se.se);
        }
    }
    
    cout << (used <= k ? mid : mid + 1) << endl;
    return 0;
}

Measured memory_bytes: 11376
#include<iostream>
using namespace std;
int a,b,c,k;
int cc[1000],cci=0;
int main(){
	cin>>a>>b>>k;
	while(c<=min(a,b))
		while(c<=min(a,b)){
			++c;
			if(a%c==0&&b%c==0){
				cc[cci]=c;
				++cci;
				break;
			}
		}
	cout<<cc[cci-k];
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+5;
const ll mod = 1e9+7;
const int mmax = 1e6 + 10;
ll fac[mmax + 5];
ll inv[mmax + 5];
ll qpow(ll a, ll b)
{
    ll r = 1, t = a;
    while (b) {
        if (b & 1)r = (r*t) % mod;
        b >>= 1;
t = (t*t) % mod;
    }
    return r;
}
void init()
{
    fac[0] = 1;
    for (int i = 1;i <= mmax;i++) fac[i] = fac[i - 1] * 1ll * i%mod;
    inv[mmax] = qpow(fac[mmax], mod - 2);
    for (int i = mmax - 1;~i;i--) inv[i] = inv[i + 1] * 1ll * (i + 1) % mod;
}
ll C(ll n, ll m)
{
    if (m>n) return 0;
    if (m == n || m == 0) return 1;
    return fac[n] * 1ll * inv[n - m] % mod*inv[m] % mod;
}
int main()
{
    init();
    int x,y;
    cin>>x>>y;
    if((x+y)%3!=0)
    {
        cout<<0;
    }
    else{
        int sum=(x+y)/3;
        if(x>=sum&&y>=sum){
            cout<<C(sum,x-sum);
        }
        else cout<<0;


    }

    return 0;
}


Measured memory_bytes: 15872
#include <stdio.h>

void day(int month, int today);

int main(void)
{
	int year, month;
	
	while (1){
		scanf("%d %d", &year, &month);
		if (year == 0 && month == 0) {
			break;
		}
		day(year, month);
	}
	
	return (0);
}

void day(int month, int today)
{
	int sa;
	int year;
	sa = 0;
	for (year = 1; year < month; year++) {
		if (year == 1 || year == 3 || year == 5 || year == 7 || year == 8 || year == 10 || year == 12) {
			sa += 31;
		}
		else if (year == 2) {
			sa += 29;
		}
		else {
			sa += 30;
		}
	}
	sa += today;
	
	if (sa % 7 == 0) {
		printf("Wednesday\n");
	}
	else if (sa % 7 == 1) {
		printf("Thursday\n");
	}
	else if (sa % 7 == 2) {
		printf("Friday\n");
	}
	else if (sa % 7 == 3) {
		printf("Saturday\n");
	}
	else if (sa % 7 == 4) {
		printf("Sunday\n");
	}
	else if (sa % 7 == 5) {
		printf("Monday\n");
	}
	else if (sa % 7 == 6) {
		printf("Tuesday\n");
	}
}
		

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

#define     fast()              ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); 
#define     ll                  long long int
#define     test()              ll t; cin>>t; while(t--) 
#define     lp0(i,begin,end)    for(ll i=begin;i<end;i++)
#define     lp1(i,begin,end)    for(ll i=begin;i<=end;i++)
#define     rlp(i,begin,end)    for(ll i=end;i>=begin;i--)
#define     prec(n)             fixed<<setprecision(n)
#define     initial(a,i)        memset(a,i,sizeof(a))
#define     pb                  push_back
#define     PI                  3.1415926535897932384626433832795
#define     MOD                 1000000007
#define     F                   first
#define     S                   second
#define     all(a)              (a).begin(),(a).end()
#define     BPC(x)              __builtin_popcountll(x)
#define     gcd(a,b)            __gcd(a,b)

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

ll power(ll x,ll n)
{
    ll result = 1;
    while (n)
    {
        if (n & 1)
            result = result * x;
        n = n / 2;
        x = x * x;
    }
    return result;
}


// Solution Function
void solution(ll compte)
{
    // cout<<compte<<"\n";
    string s;
    cin>>s;
    map<char,ll> mp;
    for(auto m:s)
    {
        mp[m]++;
    }
    if(mp['A']>0 && mp['B']>0)
    {
        cout<<"Yes";
    }
    else cout<<"No";
}
// Driver Function
int main()
{
    ll compte = 1;
    //test()
    //{
        solution(compte);
        compte++;
    //}
    return 0;
}


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

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vint;
typedef vector<double> vdbl;
typedef vector<ll> vll;
typedef vector<string> vstr;
typedef vector<vector<int> > vvint;
typedef vector<pair<int, int> > vpii;
typedef vector<pair<ll, ll> > vpll;
typedef priority_queue<int, vector<int>, greater<int> > spqint; //小さい順に取り出し
typedef priority_queue<ll, vector<ll>, greater<ll> > spqll;     //小さい順に取り出し
typedef priority_queue<int, vector<int>, less<int> > bpqint;    //大きい順に取り出し
typedef priority_queue<ll, vector<ll>, less<ll> > bpqll;        //大きい順に取り出し

#define REP(i, n) for (int(i) = 0; (i) < (int)(n); i++)
#define FOR(i, a, b) for (int(i) = a; (i) < (int)b; i++)
#define IREP(i, v) for (auto i = v.begin(); i != v.end(); i++)
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define PF push_front
#define TS to_string
#define BS binary_search
#define LB lower_bound
#define UB upper_bound
#define NP next_permutation
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) (ll) x.size()
#define SP(x) setprecision((ll)x)

const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
const double PI = M_PI;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } //最大公約数
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }     //最小公倍数

void yes()
{
    cout << "Yes" << endl;
}
void no()
{
    cout << "No" << endl;
}
//----------------------------------------

int N ;
vector<string> vec ;
vector<string> dc = { "3", "5", "7" } ;

void dfs_list(int d,string s){
    vec.push_back(s) ;
    if(d==N){
        return ;
    }
    for(int i=0;i<dc.size();i++){
        dfs_list(d+1,s+dc[i]) ;
    }
}

//-----------------------------------------
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    N = 9 ;
    int n ;
    cin >> n ;
    

    dfs_list(0,"") ;

    vll vv ;
    REP(i,SZ(vec)){
        int cnt3 = 0;
        int cnt5 = 0 ;
        int cnt7 = 0 ;
        REP(j,SZ(vec[i])){
            if(vec[i][j]=='3'){
                cnt3++ ;
            }
            else if(vec[i][j]=='5'){
                cnt5++ ;
            }
            else{
                cnt7++ ;
            }
        }
        if(cnt7!=0 && cnt3!=0 && cnt5!=0){
            vv.PB(stol(vec[i])) ;
        }
    }


    sort(ALL(vv)) ;

    auto itr = UB(ALL(vv),n) ;
    int ans = distance(vv.begin(),itr) ;

    cout << ans <<endl ;

    

    return 0;
}


Measured memory_bytes: 2812
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtCodeeeer
{
    class AtCOOOOOOOOOOOder
    {
        static int[] hs;
        static long ans;
        static void Main(string[] args)
        {
            int[] s = ReadLine().Split(' ').Select(int.Parse).ToArray();
            int a = s[0];
            int b = s[1];
            int c = s[2];
            int x = s[3];
            int y = s[4];

            long ans = 0;

            if (a+b > c*2)
            {
                while (x>0 || y>0)
                {
                    if (x == 0)
                    {
                        if (b > c*2)
                        {
                            ans += c * 2;
                            y--;
                        }
                        else
                        {
                            ans += b * y;
                            y = 0;
                            break;
                        }
                    }
                    else if (y == 0)
                    {
                        if (a > c * 2)
                        {
                            ans += c * 2;
                            x--;
                        }
                        else
                        {
                            ans += a * x;
                            x = 0;
                            break;
                        }
                    }
                    else
                    {
                        ans += c * 2;
                        x--;
                        y--;
                    }
                }
            }
            else
            {
                ans += a * x;
                ans += b * y;
            }
            WriteLine(ans);
        }
    }
}



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

using namespace std;
using ll =long long;
typedef pair<int,int> P;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
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; }
//Write From this Line

int main()
{
	int h, w; cin >> h >> w; 
	int n; cin >> n; 
	int si, sj; cin >> si >> sj;
	string s, t; cin >> s >> t;

	// 右で落とす
	int pos = sj;
	rep(i,n){
		if(s[i] == 'R') pos ++;
		if(pos > w){
			cout << "NO" << endl;
			return 0;
		}
		if(t[i] == 'L') {
			if(pos > 1)	pos--;
		}
	}
	pos = sj;
	rep(i,n){
		if(s[i] == 'L') pos--;
		if(pos < 1){
			cout << "NO" << endl;
			return 0;
		}
		if(t[i] == 'R') {
			if(pos < w) pos++;
		}
	}
	pos = si;
	rep(i,n){
		if(s[i] == 'U') pos--;
		if(pos < 1){
			cout << "NO" << endl;
			return 0;
		}
		if(t[i] == 'D') {
			if(pos < h) pos ++;
		}
	}
	pos = si;
	rep(i,n){
		if(s[i] == 'D') pos++;
		if(pos > h){
			cout << "NO" << endl;
			return 0;
		}
		if(t[i] == 'U'){
			if(pos > 1) pos--;
		}
	}
	cout << "YES" << endl;
}


Measured memory_bytes: 776
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#define llong long long
using namespace std;

const int N = 4000;
const int P = 998244353;
llong dp[N+3][N+3];
char str[N+3];
int sa[N+3],sb[N+3];
int n;

int main()
{
	scanf("%s",str+1); n = strlen(str+1);
	for(int i=1; i<=n; i++)
	{
		int x = str[i]-'0',y = 2-x;
		sa[i] = sa[i-1]+x; sb[i] = sb[i-1]+y;
	}
	for(int i=n+1; i<=n+n; i++) sa[i] = sa[i-1],sb[i] = sb[i-1];
	dp[0][0] = 1ll;
	for(int i=1; i<=n+n; i++)
	{
		for(int j=max(0,i-sb[i]); j<=min(i,sa[i]); j++)
		{
			dp[i][j] = 0ll;
			dp[i][j] += dp[i-1][j];
			if(j>0) dp[i][j] += dp[i-1][j-1];
//			printf("dp[%d][%d]=%lld\n",i,j,dp[i][j]);
			dp[i][j] %= P;
		}
	}
	llong ans = 0ll;
	for(int i=0; i<=n+n; i++) ans = (ans+dp[n+n][i])%P;
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 123392
MOD = 998244353
n, S = map(int, input().split())
a = list(map(int, input().split()))
dp1 = [[0 for _ in range(S+1)] for _ in range(n+1)]
dp2 = [[0 for _ in range(S+1)] for _ in range(n+1)]
for i in range(1, n+1): #Lのみ定めたdp1
	for s in range(S+1):
		if s < a[i-1]:
			dp1[i][s] = dp1[i-1][s] % MOD
		elif s == a[i-1]:
			dp1[i][s] = (dp1[i-1][s] + i) % MOD
		else:
			dp1[i][s] = (dp1[i-1][s] + dp1[i-1][max(s-a[i-1],0)]) % MOD

for i in range(1, n+1): #L, Rを定めたdp2
	for s in range(S+1):
		if s < a[i-1]:
			dp2[i][s] = dp2[i-1][s] % MOD
		elif s == a[i-1]:
			dp2[i][s] = (dp2[i-1][s] + i*(n-i+1)) % MOD
		else:
			dp2[i][s] = (dp2[i-1][s] + dp1[i-1][max(s-a[i-1],0)] * (n-i+1)) % MOD

print(dp2[n][s])

Measured memory_bytes: 193800
/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   all(a) (a.begin(),a.end())
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

inline void solve(){
    int a,b,c,d,ans=0; 
    cin>>a>>b>>c>>d; 
    int fifth=(c*d)/__gcd(c,d) ; 
    ans = (b-a+1) - ((b/c-(a-1)/c)+(b/d-(a-1)/d)) ; 
    ans += ((b/fifth-(a-1)/fifth));
    cout << ans << endl;
}

signed main()
{
    int n=1; // cin>>n;
    while (n--) solve();
    return 0;
}


Measured memory_bytes: 3612
#include<iostream>
#include<math.h>
#include <algorithm>
#include<float.h>
#include <limits>
#include <vector> 
#include <numeric>
#include <string.h>

#define rep(i,a,n) for(ll int (i) = (a);(i) < (n);(i)++)
#define urep(i,a,n) for(ll int (i) = (a);(i) > (n);(i)--)
#define MOD 1000000007
#define ll long long

using namespace::std;

int jo(ll int jxo, ll int jyo){
	ll int jhogeo = 1;
	rep(jinto,0,jyo) jhogeo=jhogeo*jxo;
	return jhogeo;
}
char tobig(char toxbig){
  return (toxbig-0x20);
}
char tolow(char toxlow){
  return (toxlow+0x20);
}
  


int main(){
  double a,b;
  cin>>a>>b;
  cout<<a/b;
}
// int *p = new int[N];

//  vector<int> 変数名(要素数);
//  sort(変数名.begin(),変数名.end());//昇順ソート

// vector<vector<int>> 変数名(左の個数, vector<int>(右の個数));

//


Measured memory_bytes: 256
import java.util.*;
import static java.lang.Integer.*;
//import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		int[] a = new int[n];
		for(i=0;i<n;i++) {
			a[i] = parseInt(sc.next());
		}
		int[] b = new int[n];
		for(i=0;i<n;i++) {
			b[i] = parseInt(sc.next());
		}
		int[] c = new int[n];
		for(i=0;i<n-1;i++) {
			c[i] = parseInt(sc.next());
		}
		int ans = b[a[0]-1];
		for(i = 1; i < n; i++) {
			ans += b[a[i]-1];
			if(a[i]==a[i-1]+1) {
				ans += c[a[i-1]-1];
			}
		}
		out.println(ans);
	}
}


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

class Program
{
	static void Main(string[] args)
	{
		// 文字列の入力
		var s = Console.ReadLine();
		var targetList = new List<string>() { "dream", "dreamer", "erase", "eraser" };

		// 逆さから読むとかぶらない・・・
		s = string.Join("", s.Reverse());
		targetList = targetList.Select(x => string.Join("", x.Reverse())).ToList();
		var hitFlag = true;

		for (int i = 0; i < s.Length;)
		{
			var flag2 = false;
			foreach (var word in targetList)
			{
				if (s.Length - i < word.Length)
					continue;
				else if (s.Substring(i, word.Length) == word)
				{
					i += word.Length;
					flag2 = true;
					break;
				}
			}
			if (!flag2)
			{
				hitFlag = false;
				break;
			}
		}

		if (hitFlag)
			Console.WriteLine("YES");
		else
			Console.WriteLine("NO");


	}

}

Measured memory_bytes: 16608
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<l_l> vpl;
typedef vector<string> vs;
typedef pair<l_l,ll> lll;
#define pb push_back
#define sz(x) (int)(x).size()
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=1;i<=(n);i++)
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=10100100100100100;
const ll dx[4]={1,-1,0,0};
const ll dy[4]={0,0,1,-1};
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;
}
int main(){
    ll a,b,h;cin>>a>>b>>h;
    cout<<((a+b)*h)/2<<endl;
    return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
	
	int n, k;
	cin >> n >> k;
	int t = 1;
	rep(i, n){
		if(t < k) t *= 2;
		else t += k;
	}
	cout << t << endl;
	return 0;
}

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



using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;


//container util
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)



int main(void){

	int A, B, X; cin >> A >> B >> X;
	if(A <= X and X <= (A+B)) cout << "YES" << endl;
	else cout << "NO" << endl;


	return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
 
int main()
{
  int N, M;
  cin >> N >> M;

  vector<vector<int>> A(M,vector<int>(2));
  REP(i, M){
    REP(j, 2){
      cin >> A.at(i).at(j);
    }
  }
  
  
  REP(i,N){
    int cnt = 0;
    REP(j,M){
      REP(k,2){
        if(A.at(j).at(k)-1 == i){
          cnt++;
        }
      }
    }
    cout << cnt << endl;
  }
}

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

int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	ll t;
	t =1;
	while(t--)
	{
    ll n,m;
    cin>>n>>m;
    ll ans = 0;
    if(n>1) ans+=n*(n-1);
    if(m>1) ans+=m*(m-1);
    cout<<ans/2<<"\n";
	}
}

Measured memory_bytes: 256
#include<iostream>
#include <algorithm>
#include<cstdio>
#include<string>
#include<math.h>
#include<vector>
#include <queue>
#include <bits/stdc++.h>
#include <map>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define srep(i,s,t) for (int i = s; i < t; i++)
#define drep(i,n) for(int i = (n)-1; i >= 0; i--)
using namespace std;
typedef vector<vector<char>> field_t;

typedef pair<int, int> point_t;

int main()
{
    int N,K,i,ans;
    ans=0;
    cin >> N >> K;
    vector<int> d(K),T(N,1);
    i=0;
    while(i<K){
        cin >> d[i];
        vector<vector<int>> A(K,vector<int>(d[i]) );
        rep(j,d[i]){
            cin >> A[i][j];
            T[A[i][j]-1]=0;
        }
        i++;
    }
	rep(i,N){
        if(T[i]){
            ans++;
        }
    }
    cout << ans <<endl;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef pair<ii, int> ri3;
#define mp make_pair
#define pb push_back
#define fi first
#define sc second
#define SZ(x) (int)(x).size()
#define ALL(x) begin(x), end(x) 
#define REP(i, n) for (int i = 0; i < n; ++i) 
#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define RFOR(i, a, b) for (int i = a; i >= b; --i)

const int MX_N=1005;
int xs,ys,xt,yt,N,x[MX_N+2],y[MX_N+2],r[MX_N+2];
vector<pair<int,ld> > al[MX_N];
ld d[MX_N];
priority_queue<pair<ld,int>,vector<pair<ld,int> >,greater<pair<ld,int> > > pq;

int main() {
    //freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>xs>>ys>>xt>>yt;
    cin>>N;
    FOR(i,1,N){
        cin>>x[i]>>y[i]>>r[i];
    }
    x[0]=xs; y[0]=ys; r[0]=0;
    x[N+1]=xt; y[N+1]=yt; r[N+1]=0;

    FOR(i,0,N+1){
        FOR(j,i+1,N+1){
            ld w=max((ld)0,sqrt((ld)pow((ld)x[i]-x[j],2)+pow((ld)y[i]-y[j],2))-(r[i]+r[j]));
            al[i].emplace_back(j,w);
            al[j].emplace_back(i,w);
        }
    }

    fill(d,d+N+2,-1.0);
    d[0]=0; pq.emplace(0,0);
    while(!pq.empty()){
        ld w=pq.top().fi; int u=pq.top().sc; pq.pop();
        if(w>d[u])continue;
        for(auto v:al[u]){
            if(d[v.fi]<0||w+v.sc<d[v.fi]){
                d[v.fi]=w+v.sc;
                pq.emplace(d[v.fi],v.fi);
            }
        }
    }
    cout<<fixed<<setprecision(10)<<d[N+1];
}



Measured memory_bytes: 43024
#include <iostream>

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

    for (int i = a; i <= b; i++)
    {
        if (i % k == 0)
        {
            std::cout << "OK" << std::endl;
            return 0;
        }
    }
    std::cout << "NG" << std::endl;

    return 0;
}

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

vector<int> group;
int Find(int v) {
    if (v == group[v])
        return v;
    return group[v] = Find(group[v]);
}
void Union(int u, int v) {
    group[Find(u)] = Find(v);
}

int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr);
    int n, m;
    cin >> n >> m;
    group.resize(n);
    iota(group.begin(), group.end(), 0);
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        Union(a - 1, b - 1);
    }
    vector<int> cnt(n);
    for (int i = 0; i < n; i++) {
        cnt[Find(i)]++;
    }
    cout << *max_element(cnt.begin(), cnt.end());
    return 0;
}

Measured memory_bytes: 7792
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define int long long
#define big 998244353
#define ff first
#define se second
#define pb push_back
#define pii pair<int,int>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define PSET(x,y) fixed<<setprecision(y)<<x
#define mp make_pair
#define pi 3.141592653589
int power(int x,int y){
    int r=1,z=x;
    while(y){
        if(y & 1)r*=z;
        z*=z;y=y>>1;}
    return r;}
int powerm(int x,int y,int p){
    int r=1;
    while(y){
        if(y & 1)r=(r*x)%p;
        y=y>>1;
        x=(x*x)%p;}
    return r%p;}
int modinv(int x,int m){
    return powerm(x,m-2,m);}
int logarithm(int a,int b){
    int x=0;
    while(a>1){
        x++;
        a/=b;}
    return x;}
int32_t main(){
    fast;
    string s;
    cin>>s;
    if(s[1]=='B')
        cout<<"ARC";
    else
        cout<<"ABC";
    return 0;
}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

typedef long long ll;

const int INF = 1000000000;
const int MOD = 1000000007;

int main () {
    int M; cin >> M;
    cout << 48 - M << endl;
}



Measured memory_bytes: 256
#include <iostream>

int main(){
    int i,a,b,c;
    int count = 0;
    std::cin >> a >> b >> c;
    for(i=a;i<b+1;i++){
        if(c%i == 0) count++;
    }
    std::cout << count << std::endl;
    return 0;
}


Measured memory_bytes: 3128
#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < n; ++i)
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())
#define FORV(i, v) for (auto i = v.begin(); i != v.end(); i++)
using namespace std;

typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const int INF = 1001001001;
const long long INFL = (1LL<<60);
const double eps = (1e-9);

int mod = int(1e+9) + 7;


int main() {
  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: 256
#include<iostream>
using namespace std;

int main(){
    int N;
    cin >> N;
    string W[N];
    for (int i=0; i<N; i++) {
        cin >> W[i];
    }

    for (int i=0; i<N; i++) {
        string test = W[i];
        for (int j=0; j<N; j++) {
            if (i != j && test == W[j]) {
                cout << "No" << endl;
                return 0;
            }          
        }
    }

    string test = W[0];
    for (int i=1; i<N; i++) {
        //cout << test << " " << W[i] << endl;
        if (test[test.size()-1] != W[i][0]) {
            cout << "No" << endl;
            return 0;
        }
        test = W[i];
    }

    cout << "Yes" << endl;
    return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;

const int N = 107;
const int W = 1e5 + 7;

const ll Inf = 1e18;
ll dp[N][W];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.setf(ios::fixed); cout.precision(20);
    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    for (int i = 0; i < N; ++i) {
        for (int j = 0; j < W; ++j) {
            dp[i][j] = Inf;
        }
    }
    dp[0][0] = 0;
    int n, w;
    cin >> n >> w;
    for (int i = 1; i <= n; ++i) {
        int v, c;
        cin >> v >> c;
        for (int j = 0; j < W; ++j) {
            dp[i][j] = dp[i - 1][j];
            if (j >= c) {
                dp[i][j] = min(dp[i][j], dp[i - 1][j - c] + v);
            }
        }
    }
    int ans = 0;
    for (int i = 0; i < W; ++i) {
        if (dp[n][i] <= w) {
            ans = i;
        }
    }
    cout << ans << '\n';
}

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



int main(){
 string S;
 cin >> S;
 if (S=="a"){
    cout << 'b' << endl;
 }
 if (S=="b"){
    cout << "c" << endl;
 } 
 if (S=="c"){
    cout << "d" << endl;
 } 
 if (S=="d"){
    cout << "e" << endl;
 } 
 if (S=="e"){
    cout << "f" << endl;
 } 
 if (S=="f"){
    cout << "g" << endl;
 } 
 if (S=="g"){
    cout << "h" << endl;
 } 
 if (S=="h"){
    cout << "i" << endl;
 } 
 if (S=="i"){
    cout << "j" << endl;
 } 
 if (S=="j"){
    cout << "k" << endl;
 } 
 if (S=="k"){
    cout << "l" << endl;
 } 
 if (S=="l"){
    cout << "m" << endl;
 } 
 if (S=="m"){
    cout << "n" << endl;
 } 
 if (S=="n"){
    cout << "o" << endl;
 } 
 if (S=="o"){
    cout << "p" << endl;
 } 
 if (S=="p"){
    cout << "q" << endl;
 } 
 if (S=="q"){
    cout << "r" << endl;
 } 
 if (S=="r"){
    cout << "s" << endl;
 } 
 if (S=="s"){
    cout << "t" << endl;
 } 
 if (S=="t"){
    cout << "u" << endl;
 } 
 if (S=="u"){
    cout << "v" << endl;
 } 
 if (S=="v"){
    cout << "w" << endl;
 } 
 if (S=="w"){
    cout << "x" << endl;
 } 
 if (S=="x"){
    cout << "y" << endl;
 } 
 if (S=="y"){
    cout << "z" << endl;
 }
 
 
 
}

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

int main()
{
	int a = 0;
	int b = 0;

	cin >> a >> b;

	if(a > b)
		cout << "a > b" << endl;
	else if(a < b)
		cout << "a < b" << endl;
	else
		cout << "a == b" << endl;

	return 0;
}

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

int main(){
    string s;
    cin>>s;
    for(int i=0;i<s.size();i++){
        if(s[i]==','){
            cout<<' ';
        }else{
            cout<<s[i];
        }
    }
    return 0;
}

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


int findSumOfDigits(int n) {
    int sum = 0;
    while (n > 0){
        sum += n % 10;
        n /= 10;
    }

    return sum;
}


int main() {
    int N, A, B;
    cin >> N >> A >> B;
    int total = 0;

    for (int i = 1; i <= N; ++i) {
        int sum = findSumOfDigits(i);
        if (sum >= A && sum <= B) {
            total += i;
        }
    }

    cout << total << endl;
}

Measured memory_bytes: 256
#include<cstdio>
using namespace std;
int n,i,a,maxn=0,minn=1000000007;
int main()
{
scanf("%d",&n);
for(i=1;i<=n;i++)
{
	scanf("%d",&a);
	if(a>maxn)maxn=a;
	if(a<minn)minn=a;
}
printf("%d",maxn-minn);
}

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

const ll mod = 1e9+7;


int main() {

    ll n,a;
    cin>>n>>a;
    ll b[n];
    for(ll i=0;i<n;i++){
        cin>>b[i];
    }

    ll dp[n+1][(ll)2600][n+1];
    memset(dp,0,sizeof(dp));
    // Base Case
    for(ll i=0;i<=n;i++){
        dp[i][0][0]=1;
    }

    // Rec Case
    for(ll i=1;i<=n;i++){
        for(ll j=1;j<=2500;j++){
            for(ll k=1;k<=n;k++){
                // Choosing k elements from 1 to i having sum as j
                if(k>i){
                    dp[i][j][k]=0;
                }   
                else{
                    dp[i][j][k]+=dp[i-1][j][k];
                    if(j>=b[i-1]){
                        dp[i][j][k]+=dp[i-1][j-b[i-1]][k-1];
                    }
                }
            }
        }
    }

    ll ans=0;
    for(ll i=1;i<=n;i++){
        ans+=dp[n][a*i][i];
    }

    cout<<ans<<endl;

}


Measured memory_bytes: 53120
numal=lambda c:chr(c+97)
n=int(input())
unchi=[[],[],[],[],[],[],[],[],[],[]]
unchi[0].append("0")
k=1
if n>=2:
	while k<n:
		for i in range(len(unchi[k-1])):
			t=max(map(int, unchi[k-1][i]))
			for u in range(t+2):
				unchi[k].append(unchi[k-1][i]+str(u))
		k+=1
for i in range(len(unchi[n-1])):
	s = []
	for k in range(n):
		s.append(numal(int(unchi[n-1][i][k])))
	print("".join(s))

Measured memory_bytes: 14580
#include<bits/stdc++.h>
using namespace std;
int main(){
	string a, b, c;
	cin >> a >> b >> c;
	string ans = "NO";
	if(a[a.size() - 1] == b[0] && b[b.size() - 1] == c[0])ans = "YES";
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;

void solve() {
  int n;
  string s;
  cin >> n >> s;
  int r = 0;
  int b = 0;
  for(int i = 0; i < s.size(); i++) if(s[i] == 'R') r++; else b++;
  if(r > b) cout << "Yes\n";
  else cout << "No\n";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
  /*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
  */
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<map>
using namespace std;
#define int long long
typedef pair<int, int> P;

signed main() {
	int x, y;
	cin >> x >> y;
	int ans = 0;
	while (x <= y) {
		x *= 2;
		ans++;
	}
	cout << ans << endl;
}

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

using namespace std;

int a[111][2];
int main() {
	int n, x = 0;
	cin >> n;
	int m = (n + 1) / 2;
	for (int i = 0; i < n / 2; i++)
		a[i][0] = i + 1, a[i][1] = n / 2 * 2 - i;
	if (n % 2) a[m - 1][0] = n;
	if (m > 2) a[m][0] = a[0][0], a[m][1] = a[0][1], m++;
	stringstream s;
	for (int i = 1; i < m; i++)
		for (int j = 0; j < 2; j++)
			for (int k = 0; k < 2; k++)
				if (a[i - 1][j] && a[i][k]) s << a[i - 1][j] << ' ' << a[i][k] << '\n', x++;
	cout << x << '\n' << s.str() << flush;
	return 0;
}


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

#define FOR(i,l,r) for(int i = (int) l;i < (int) r;i++)
#define ALL(x) x.begin(),x.end()
template<typename T> bool chmax(T& a,const T& b){ return a < b ? (a = b,true) : false; }
template<typename T> bool chmin(T& a,const T& b){ return b < a ? (a = b,true) : false; }
typedef long long ll;

int SX,SY,TX,TY;

int main()
{
	cin >> SX >> SY >> TX >> TY;

	string ans = string(TX - SX,'R') + string(TY - SY,'U') + string(TX - SX,'L') + string(TY - SY,'D');
	ans += 'D' + string(TX - SX + 1,'R') + string(TY - SY + 1,'U') + 'L';
	ans += 'U' + string(TX - SX + 1,'L') + string(TY - SY + 1,'D') + 'R';

	cout << ans << endl;

	return 0;
}


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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

int A, B, H, M;

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

  std::cin >> A >> B >> H >> M;

  int m = H * 60 + M;
  double PI = std::acos(-1);

  std::complex<double> z1 = std::polar<double>(A, 2.0 * PI / 360 * 0.5 * m),
      z2 = std::polar<double>(B, 2.0 * PI / 360 * 6.0 * m);
      
  double res = std::abs(z1 - z2);
  
  printf("%.10f\n", res);
}


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

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define all(V) V.begin(),V.end()
#define ll long long
#define MOD 1000000007

int main() {
	ll N, cnt = LLONG_MAX;
	cin >> N;
	for (ll i = 1;i * i <= N;i++) {
		if (N % i == 0) {
			cnt = min(cnt, i + N / i - 2);
		}
	}
	cout << cnt << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int maxn = 2e5 + 5;
ll n, T, b[maxn], t = 0, m = 0 , k, a[maxn], ans, vit[maxn], f[maxn];
struct dang
{
    ll x, y, dd;
};

dang c[maxn];
bool check, ck;
string s;
vector<ll> adj[2][maxn];
inline void sol()
{
    cin >> n;
    ans = 0;

    for(int i = 1; i <= n; i ++)
    {
        ll k, l, r;
        cin >> k >> l  >> r;
        if(l >= r)
        {
            adj[0][k].pb(l - r);
        }
        else
        {
            adj[1][n-k].pb({r - l});
        }
        ans += min(l, r);
    }
    for(int v = 0; v < 2; v ++)
    {
        priority_queue< ll, vector<ll>, greater<ll> >pr;
        for(int i = 1; i <= n; i ++)
        {
            for(ll u : adj[v][i])
            {
                pr.push(u);
                ans += u;
            }
            while((ll)pr.size() > i)
            {
                ans -= pr.top();
                pr.pop();
            }
        }
    }

    cout << ans << '\n';
    for(int i = 1; i <= n; i ++)adj[0][i].clear(), adj[1][i].clear();
}
int main()
{
	ios_base::sync_with_stdio(0);
	cout.tie(0);
	cin.tie(0);
	cin >> T;
	while(T -- > 0)
	sol();
}


Measured memory_bytes: 19140
#include<stdio.h>

int main(){
    int co[4]={0};
    int i,buff1,buff2,count=0;

    for(i=0;i<3;i++){
        scanf("%d %d",&buff1,&buff2);
        co[buff1-1]++; co[buff2-1]++;
    }
    for(i=0;i<4;i++){
        if(co[i]==2){
            count++;
        }
    }
    if(count==2){
        printf("YES");
    }else{printf("NO");}
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};



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

	ll n;
	cin >> n;
	if(n%2==0)cout << n << endl;
	else cout << 2*n << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
    string s;
    string u;
    int a;
    int b;
    string t;
    cin >> s >>t;
    cin >> a >> b;
    cin >> u;
    if (s == u) {
        cout << a-1 << " " << b << endl;
    } else {
        cout << a << " " << b-1 << endl;
    }
    return 0;
}


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

using namespace std;

int main(){
	
	string str;
	
	cin >> str;
	
	int flag = 0;
	
	for(int i = 0; i < str.size(); i++){
		if(flag == 0){
			if(str[i] == 'C'){
				flag = 1;
			}
		}else if(flag == 1){
			if(str[i] == 'F'){
				flag = 2;
			}
		}
	}
	
	if(flag == 2){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
string s;
bool compare(pair<int,int> a, pair<int,int> b) {
  return s.substr(a.first,a.second) < s.substr(b.first,b.second);
}
int main() {
  int K;
  cin >> s >> K;
  set<string> X;
  for (int i = 0; i < s.length(); i++) {
    for (int j = 1; j <= K && i+j <= s.length(); j++) {
      X.insert(s.substr(i,j));
    }
  }
  for (auto p : X) {
    if (!(--K)) {
      cout << p;
      return 0;
    }
  }
}

Measured memory_bytes: 4748
def gi() gets.to_i end
def gs() gets.chomp end
def gim() gets.split.map(&:to_i) end
def gsm() gets.split.map(&:chomp) end
def YesNo1(bool, yes="Yes", no="No") puts (bool ? yes : no) end
def YESNO2(bool, yes="YES", no="NO") puts (bool ? yes : no) end
def sqrt(i) i ** (1.0/2) end

require "bigdecimal"
#####

s = gs.split("")
n = s.count
kaibun = (s == s.reverse)
f_kaibun = (s[0..(((n-1)/2)-1)] == s[0..(((n-1)/2)-1)].reverse)
l_kaibun = (s[(((n+3)/2)-1)..n-1] == s[(((n+3)/2)-1)..n-1].reverse)
if kaibun && f_kaibun && l_kaibun
  puts "Yes"
else
  puts "No"
end

Measured memory_bytes: 3836
N = int(input())

ac = 0
wa = 0
tle = 0
re = 0

for i in range(N):
    S = input()
    if S == "AC":
        ac += 1
    elif S == "WA":
        wa += 1
    elif S == "TLE":
        tle += 1
    else:
        re += 1

print("AC x {}".format(ac))
print("WA x {}".format(wa))
print("TLE x {}".format(tle))
print("RE x {}".format(re))


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

int main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;

    int left = a + b;
    int right = c + d;

    if (left > right)
    {
        cout << "Left" << endl;
    }
    else if (left == right)
    {
        cout << "Balanced" << endl;
    }
    else
    {
        cout << "Right" << endl;
    }
}

Measured memory_bytes: 256
fn read<T: std::str::FromStr>(
    stdin_lock: &mut std::io::StdinLock,
    buf: &mut Vec<u8>,
    delimiter: u8,
) -> T {
    buf.clear();
    let l = std::io::BufRead::read_until(stdin_lock, delimiter, buf).unwrap();
    buf.truncate(l - 1); // remove delimiter
    let s = unsafe { std::str::from_utf8_unchecked(&buf) };
    s.parse().unwrap_or_else(|_| panic!("read"))
}

fn main() {
    let stdin = std::io::stdin();
    let mut stdin_lock = stdin.lock();
    let mut buf: Vec<u8> = Vec::new();
    let t = read(&mut stdin_lock, &mut buf, b' ');
    let x = read(&mut stdin_lock, &mut buf, b'\n');
    println!("{}", solve(t, x));
}

fn solve(t: i32, x: i32) -> String {
    format!("{0:.10}", f64::from(t) / f64::from(x))
}

#[test]
fn example1() {
    assert_eq!("2.6666666667", solve(8, 3))
}

#[test]
fn example2() {
    assert_eq!("99.0000000000", solve(99, 1))
}

#[test]
fn example3() {
    assert_eq!("0.0100000000", solve(1, 100))
}


Measured memory_bytes: 4352
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n, m = map(int, readline().split())
    if 2 * n > m:
        ans = min(n, m // 2)
    else:
        c = m - 2 * n
        ans = n + c // 4

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 61864
N=int(input())
P=0
def f(x):
  global N,P
  if x>N:
    return None
  s=str(x)
  if '7' in s and '5' in s and '3' in s:
    P+=1
  f(x*10+7)
  f(x*10+5)
  f(x*10+3)
f(7)
f(5)
f(3)
print(P)

Measured memory_bytes: 74476
#include<cstdio>
#include<iostream>
#include<fstream>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
#define Set(a) memset(a,0,sizeof(a))
#define F(i,a,b) for(register int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(register int i=a,i##end=b;i>=i##end;--i)
#define openf(a) freopen(#a".in","r",stdin);freopen(#a".out","w",stdout)
#define re register
#define ri re int
#define il inline
typedef long long ll;
typedef unsigned long long ull;
template<typename T> inline T rd(T& x)
{
	T f=1;x=0;char c=getchar();
	for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
	for(; isdigit(c);c=getchar()) x=(x<<3)+(x<<1)+(T)(c-'0');
	x*=f;
	return x;
}
ll rd(){ll x;rd(x);return x;}
inline int max(int a,int b){return a>b?a:b;}
inline int min(int a,int b){return a<b?a:b;}
const int inf=1<<30;

int main()
{
	double pi=3.14159265359;
	int n=rd();
	printf("%.10lf\n",pi*2*n);
	return 0;
}

Measured memory_bytes: 3764
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define rep(i, n) for(int i=0; i<n; i++)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define mk make_pair
#define fi first
#define se second
#define pb push_back
#define ALL(x) x.begin(), x.end()
#define V(T) vector<T>
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> vi;
typedef vector<vi> vvi;
int max(int a, int b) {if(b>a) return b; else return a;}
int min(int a, int b) {if(b<a) return b; else return a;}


signed main() {
    char X, Y;
    cin >> X >> Y;
    
    if(X > Y) cout << '>' << endl;
    else if(X < Y) cout << '<' << endl;
    else cout << '=' << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define int long long
#define ull unsigned long long
#define ld long double
#define rep(a) rep1(i,a)
#define rep1(i,a) rep2(i,0,a)
#define rep2(i,b,a) for(int i=(b); i<((int)(a)); i++)
#define rep3(i,b,a) for(int i=(b); i>=((int)(a)); i--)
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define sz(a) ((int)a.size())
#define pow2(x) (1ll<<(x))
#define ceiling(a,b) (((a)+(b)-1)/(b))
#define print0(a) cout << (a) << ' '
#define print1(a) cout << (a) << '\n'
#define print2(a,b) cout << (a) << ' ',print1(b)
#define print3(a,b,c) cout << (a) << ' ',print2(b,c)
#define print4(a,b,c,d) cout << (a) << ' ',print3(b,c,d)
#ifdef i_am_noob
#define debug(a) print2(#a,a)
#else
#define debug(a)
#endif
#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>

using namespace std;
using namespace __gnu_pbds;

const int Mod=1000000007,Mod2=998244353;
const int MOD=Mod;

inline int add(int a, int b){return (a+b>=MOD?a+b-MOD:a+b);}
inline int sub(int a, int b){return (a+MOD-b>=MOD?a-b:a+MOD-b);}
int Pow(int a, int b){
	if(!b) return 1;
	int tmp=Pow(a*a%MOD,b>>1);
	return (b&1?tmp*a%MOD:tmp);
}
inline int inverse(int n){return Pow(n,MOD-2);}

const int maxn=100005;
//i_am_noob
int n,goal,a[10][2],cnt,x,ans=4e18;
bool flag;

signed main(){
	ios_base::sync_with_stdio(0),cin.tie(0);
    cin >> n >> goal;
    rep(n) rep1(j,2) cin >> a[i][j];
    rep(pow2(n)){
        cnt=x=0;
        rep1(j,n) if(i&pow2(j)){
            x+=a[j][0];
            cnt+=a[j][0]*(j+1)*100+a[j][1];
        }
        if(cnt>=goal){
            ans=min(ans,x);
            continue;
        }
        flag=false;
        rep3(j,n-1,0) if((i&pow2(j))==0){
            rep1(k,a[j][0]){
                x++;
                cnt+=(j+1)*100;
                if(cnt>=goal){
                    ans=min(ans,x);
                    flag=true;
                    break;
                }
            }
            if(flag) break;
        }
    }
    print1(ans);
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s,t,ans;
  cin>>s>>t;
  ans="Yes";
  for(int i=0;i<s.size();i++){
    if(s.at(i)!=t.at(i)){
      ans="No";
      break;
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう
//a=0x61=97
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long  ll;
typedef long double  ld;
typedef string str;
typedef pair<int,int> pairii;
typedef vector<int> veci;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定　cout << fixed << setprecision(2)
int main() {
  int a,b,c,d,ans=0;
  cin>>a>>b>>c>>d;
  ans=-(max(a,c)-min(b,d));
  cout<<(ans<0?0:ans)<<endl;       
}

Measured memory_bytes: 256