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

using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using pll = pair<ll, ll>;

const ll oo = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-9;

#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORD(i, a, b) for (ll i = ll(b) - 1; i >= (a); i--)
#define TR(X)                                                  \
    ({                                                         \
        if (0) cerr << "TR: " << (#X) << " = " << (X) << endl; \
    })
#define LL(name) \
    ll name;     \
    cin >> name;
#define VL(name, num) \
    vl name(num);     \
    FOR(INPUT_VL_I, 0, num) { cin >> name[INPUT_VL_I]; }

constexpr ll MOD = 1000000007ll;

pll getNormal(pll p) {
    if (p.yy == 0) p.xx = 1;
    if (p.xx == 0) p.yy = 1;
    if (p.yy < 0) {
        return {-p.xx, -p.yy};
    } else {
        return p;
    }
}

int main() {
    cin.sync_with_stdio(0);
    LL(N);

    map<pll, ll> cnt;

    ll zeroes = 0;
    FOR(i, 0, N) {
        LL(A) LL(B);
        if (A == 0 && B == 0) {
            zeroes++;
            continue;
        }

        ll g = gcd(A, B);

        ll na = A / g;
        ll nb = B / g;

        cnt[getNormal(mp(na, nb))]++;
    }

    vl powers(N + 1);
    powers[0] = 1;
    FOR(i, 1, N + 1) powers[i] = (powers[i - 1] * 2) % MOD;

    ll ans = 1;
    for (auto it : cnt) {
        if (it.yy == 0) continue;

        TR(it.xx.xx);
        TR(it.xx.yy);
        TR(it.yy);

        ll factora = (powers[it.yy] - 1 + MOD) % MOD;
        pll other = getNormal(mp(-it.xx.yy, it.xx.xx));

        TR(other.xx);
        TR(other.yy);
        TR(cnt[other]);

        ll factorb = (powers[cnt[other]] - 1 + MOD) % MOD;
        cnt[other] = 0;

        TR(factora);
        TR(factorb);

        ans = (ans * ((factora + 1ll + factorb) % MOD)) % MOD;
        TR(ans);
    }

    cout << (ans + zeroes - 1 + MOD) % MOD << endl;
}  // cin.tie(0) bei schnellem Wechseln


Measured memory_bytes: 29892
#include <iostream>
#include <complex>
#include <cassert>
#include <vector>
#include <iomanip>

using namespace std;

typedef complex<double> P;

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)

const double eps = 1e-10;

double cross(const P& a, const P& b) {
    return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
    return real(conj(a)*b);
}

struct L : public vector<P> {
    L(const P &a, const P &b) {
        push_back(a); push_back(b);
    }
};

P crosspoint(const L &l, const L &m) {
    double A = cross(l[1] - l[0], m[1] - m[0]);
    double B = cross(l[1] - l[0], l[1] - m[0]);
    if (abs(A) < eps && abs(B) < eps) return m[0]; // same line
    if (abs(A) < eps) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
    return m[0] + B / A * (m[1] - m[0]);
}

int main(){
    cout << setprecision(3) << fixed;
    P ps[3];
    int n; cin>>n;
    rep(tt,n){
        rep(i,3){
            double x,y; cin>>x>>y;
            ps[i] = P(x,y);
        }
        P mid1 = (ps[0]+ps[1])/2.0;
        P mid2 = (ps[0]+ps[2])/2.0;

        L l1(mid1, mid1+(ps[0]-ps[1])*P(0,1));
        L l2(mid2, mid2+(ps[0]-ps[2])*P(0,1));

        P cp = crosspoint(l1,l2);

        cout << cp.real() << " " << cp.imag() << " " << abs(cp-ps[0]) << endl;
    }
}

Measured memory_bytes: 1316
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

int main(){
	string s;
	cin>>s;
	int l=s.length();
	LL ans=1LL*l*(l-1)/2+1;
	int c[30]={};
	FOR(i,0,l){
		c[s[i]-'a']++;

	}
	FORQ(i,0,'z'-'a'){
		int t=c[i];
		ans-=1LL*t*(t-1)/2;
	}
	cout<<ans<<endl;





    return 0;
}


Measured memory_bytes: 640
import scala.annotation.tailrec
import scala.collection.mutable
import scala.io.StdIn._
object Main extends App {

  val n = readInt()
  val numbers = readLine.trim.split(' ').map(_.toInt)
  operation(numbers) match {
    case Some(l) ⇒
      l.foreach(println)
    case None ⇒
      println(-1)
  }

  @tailrec
  def operation(current: Array[Int], ope: List[Int] = Nil): Option[List[Int]] = {
    if (current.isEmpty) Some(ope)
    else current.indices.reverse.find(i ⇒ current(i) == i + 1) match {
      case None ⇒ None
      case Some(i) ⇒ operation(current.removed(i), i + 1 :: ope)
    }
  }
  implicit class Wrapped(val array: Array[Int]) extends AnyVal {
    def removed(position: Int): Array[Int] = {
      Array.tabulate(array.length - 1){i ⇒ if (i >= position) array(i + 1) else array(i)}
    }
  }
  implicit class Extension[T](val value: T) extends AnyVal {
    @inline def let[A](@inline func: T ⇒ A): A = func(value)
    @inline def also(@inline func: T ⇒ Unit): T = {func(value); value}
  }
}

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

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = ReadArrayInt();
            var N = input[0];
            var M = input[1];
            var drinks = new List<int[]>();
            for (int i = 0; i < N; i++)
            {
                input = ReadArrayInt();
                drinks.Add(new int[] { input[0], input[1] });
            }
            drinks = drinks.OrderBy(d => d[0]).ToList();
            var ans = 0L;
            foreach(var d in drinks)
            {
                var A = (long)d[0];
                var B = (long)d[1];
                if (M > B)
                {
                    ans += A * B;
                    M -= (int)B;
                }
                else
                {
                    ans += A * M;
                    break;
                }
            }

            Console.WriteLine(ans);
            Console.ReadLine();
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}

Measured memory_bytes: 26548
#include<iostream>
#include<algorithm>
#include<iomanip>

int main(){
	while(1){
		int n,m;
		std::cin>>n>>m;
		if(n+m==0&&n*m==0)break;
		double dp[101][101]={};//dp[i][j]=i????????§???????????\??????j?????¨???????????????????????§???
		double grow[101][101];//i??´????????\??????j???????????\???
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++)std::cin>>grow[i][j];
		}
		for(int i=1;i<=n;i++)dp[1][i]=1.0;
		for(int i=2;i<=m;i++){
			for(int j=1;j<=n;j++){
				for(int k=1;k<=n;k++){
					dp[i][j]=std::max(dp[i][j],dp[i-1][k]*grow[k][j]);
				}
			}
		}
		double ans=0;
		for(int i=1;i<=n;i++)ans=std::max(ans,dp[m][i]);
		std::cout<<std::fixed<<std::setprecision(2)<<ans<<std::endl;
	}
	return 0;
}

Measured memory_bytes: 1448
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
void solve(){
    int a,b,c;
    cin>>a>>b>>c;
    swap(a,b);
    swap(a,c);
    cout<<a<<" "<<b<<" "<<c;
}
void trials(){
    int t;
    for(cin>>t;t--;cout<<endl){
        solve();
    }
}
int main(){
    solve();
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x,h,w) (y) < 0 || (h) <= (y) || (x) < 0 || (w) <= (x)
#define line cout << "------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause")
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
const long double pi = acos(-1);
const long double eps = 1e-10;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; }return 0; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; }return 0; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
//ate
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }

int main() {
    init();

    vector<string> m = {
        "SUN","MON","TUE","WED","THU","FRI","SAT",
        "SUN","MON","TUE","WED","THU","FRI","SAT"
    };
    string s; cin >> s;

    int ans = 1, itr = 0;
    while (m[itr] != s)++itr;
    while (m[itr + ans] != "SUN")++ans;
    cout << ans << "\n";
}


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

int main() {
	int setN;
	int gx,gy;
	int mN;
	int mX1[200],mY1[200],mX2[200],mY2[200];
	long long int ans;

	cin >> setN;

	for (int i=0;i<setN;i++) {
		cin >> gx >> gy;
		cin >> mN;
		if(mN == 0) {
			ans = 1;
			for(int j=1;j<gx+1;j++) {
				ans = ans*(gx+gy-j+1)/j;
				//cout << ans <<endl;
			}
			cout << ans <<endl;

		} else {
			for (int j=0; j<mN; j++) {
			cin >> mX1[j] >> mY1[j];
			cin >> mX2[j] >> mY2[j];
		}
			int Vert[30][30] = {};
			int Horiz[30][30] = {};
			int T[30][30] = {};
			for (int j=0;j<mN;j++) {
				if(mX1[j] == mX2[j]) {
					Horiz[mX1[j]][max(mY1[j],mY2[j])] = 1;
				} else if(mY1[j] == mY2[j]) {
					Vert[max(mX1[j],mX2[j])][mY1[j]] = 1;
				}
			}
			for (int j=0;j<30;j++){
				T[0][j] = 0;
				T[j][0] = 0;
				T[1][1] = 1;
			}
			for (int j=1;j<30;j++) {
				for (int l=1;l<30;l++) {
					if ((j != 1) || (l!= 1)) {
						if ((Vert[j-1][l-1] == 0) && (Horiz[j-1][l-1] == 0)) {
							T[j][l] = T[j][l-1] + T[j-1][l];
						}
						if ((Vert[j-1][l-1] == 0) && (Horiz[j-1][l-1] == 1)) {
							T[j][l] = T[j-1][l];
						}
						if ((Vert[j-1][l-1] == 1) && (Horiz[j-1][l-1] == 0)) {
							T[j][l] = T[j][l-1];
						}
						if ((Vert[j-1][l-1] == 1) && (Horiz[j-1][l-1] == 1)) {
							T[j][l] = 0;
						}
					}

				}
			}
			
			/*
			for (int j=0;j<15;j++) {
				cout << endl;
				for (int k =0;k<15;k++) {
					cout << Vert[j][k] << " ";
				}
			}
			cout << endl;
			for (int j=0;j<16;j++) {
				cout << endl;
				for (int k =0;k<16;k++) {
					cout <<Horiz[j][k] << " ";
				}
			}
			cout << endl;
			

			for (int j=0;j<16;j++) {
				cout << endl;
				for (int k =0;k<16;k++) {
					cout << T[j][k] << " ";
				}
			}
			*/

			if(T[gx-1][gy-1] == 0) {
				cout << "Miserable Hokusai!" << endl;
			} else {
				cout << T[gx+1][gy+1] << endl;
			}



		}


	}
}

Measured memory_bytes: 3036
#include <stdio.h>

int main() {
 int i, data[5], sum = 0, average = 0;
 for( i = 0; i < 5; i++ ) {
   scanf( "%d", &data[i] );
 }
 for( i = 0; i < 5; i++ ) {
   if( data[i] < 40 ) {
     data[i] = 40;
   }
   sum += data[i];
 }
 average = sum / 5;
 printf( "%d\n", average );
 return 0;
}

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

using namespace std;

const long long M = 1e18;
const int N = 1e5+2;
long long plecak[N];
int n,w;




int main(){
    ios_base::sync_with_stdio(0);

    cin >> n >> w;


    for (int i=1; i<N; i++) plecak[i] = M+2;
    
    int m;
    long long v;
    for (int i=0; i<n; i++){

        cin >> m >> v;

        for (int i=N-1; i>=0; i--){

            if (plecak[i] != M+2) {

                if (i+v < N) plecak[i+v] = min(plecak[i+v], plecak[i] + m);
            }
        }
    }

    int i=N-1;

    while (plecak[i] == M+2 || plecak[i] > w) i--;
    cout << i;

}

Measured memory_bytes: 1024
// #pragma GCC optimize(2)
// #pragma G++ optimize(2)
// #pragma comment(linker,"/STACK:102400000,102400000")

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

typedef long long int64;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef float fl;
typedef double dl;
typedef pair<int,int> pii;
#if (WIN32) || (WIN64) || (__WIN32) || (__WIN64) || (_WIN32) || (_WIN64) || (WINDOWS)
#define lld "%I64d"
#define llu "%I64u"
#else
#define lld "%lld"
#define llu "%llu"
#endif
#define uint(n) ((unsigned int)(n))
#define int64(n) ((long long)(n))
#define ull(n) ((unsigned long long)(n))
#define fl(n) ((float)(n))
#define dl(n) ((double)(n))
#define char(n) ((char)(n))
#define Bool(n) ((bool)(n))
#define fixpoint(n) fixed<<setprecision(n)

const int INF=1061109567;
const int NINF=-1044266559;
const int64 LINF=4557430888798830399;
const dl eps=1e-15;
#define MOD (1000000007)
#define PI (3.1415926535897932384626433832795028841971)

#define MP make_pair
#define MT make_tuple
#define All(a) (a).begin(),(a).end()
#define pall(a) (a).rbegin(),(a).rend()
#define Log(x,y) log(x)/log(y)
#define SZ(a) ((int)(a).size())
#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 repd(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define repd1(i,n) for(int i=((int)(n));i>=1;i--)
#define repv(itr,v) for(__typeof((v).begin()) itr=(v).begin();itr!=(v).end();itr++)
#define repV(i,v) for(auto i:v)
#define repE(i,v) for(auto &i:v)
#define MS(x,y) memset(x,y,sizeof(x))
#define MC(x) MS(x,0)
#define MINF(x) MS(x,63)
#define MCP(x,y) memcpy(x,y,sizeof(y))
#define UN(v) sort(All(v)),v.erase(unique(All(v)),v.end())
#define filein(x) freopen(x,"r",stdin)
#define fileout(x) freopen(x,"w",stdout)
#define fileio(x)\
	freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout)
#define filein2(filename,name) ifstream name(filename,ios::in)
#define fileout2(filename,name) ofstream name(filename,ios::out)
#define fileio2(filename,name) fstream name(filename,ios::in|ios::out)
#define sqr(x) ((x)*(x))
#define Pause system("pause")
#define Cls system("cls")
#define fs first
#define sc second
#define SF scanf
#define PF printf

const int maxn=3010;

int n,m,K,a[maxn][maxn];
int64 dp[maxn][maxn][4];

int main()
{
	SF("%d%d%d",&n,&m,&K);
	for(int i=0;i<K;i++)
	{
		int r,c,v;SF("%d%d%d",&r,&c,&v);
		a[r][c]=v;
	}

	for(int i=1;i<=n;i++) for(int j=1;j<=m;j++)
	{
		for(int k=0;k<4;k++)
		{
			dp[i+1][j][k]=max(dp[i+1][j][k],dp[i][j][k]);
			dp[i][j+1][k]=max(dp[i][j+1][k],dp[i][j][k]);
		}

		for(int k=0;k<3;k++)
		{
			dp[i][j+1][k+1]=max(dp[i][j+1][k+1],dp[i][j][k]+a[i][j]);
			dp[i+1][j][0]  =max(dp[i+1][j][0],dp[i][j][k]+a[i][j]);
		}
	}

	for(int k=0;k<4;k++)
	{
		dp[n+1][m+1][k]=max(dp[n+1][m+1][k],dp[n+1][m][k]);
		dp[n+1][m+1][k]=max(dp[n+1][m+1][k],dp[n][m+1][k]);
	}

	int64 ans=0;
	for(int i=0;i<4;i++) ans=max(ans,dp[n+1][m+1][i]);

	PF("%lld",ans);

	return 0;
}

Measured memory_bytes: 321172
var n,m,i,j:longint;
    x:array[0..1000,0..1000]of char;
    c:array[0..1000,0..1000]of longint;
begin
 readln(n,m);
 for i:=1 to n do
  begin
   for j:=1 to m do
   read(x[i,j]);
   readln;
  end;
  for i:=1 to n do
  for j:=1 to m do
  if x[i,j]<>'#' then
  begin
   if x[i-1,j-1]='#' then inc(c[i,j]);
   if x[i-1,j]='#' then inc(c[i,j]);
   if x[i-1,j+1]='#' then inc(c[i,j]);
   if x[i,j-1]='#' then inc(c[i,j]);
   if x[i,j+1]='#' then inc(c[i,j]);
   if x[i+1,j-1]='#' then inc(c[i,j]);
   if x[i+1,j]='#' then inc(c[i,j]);
   if x[i+1,j+1]='#' then inc(c[i,j]);
  end;
  for i:=1 to n do
  begin
   for j:=1 to m do
    if x[i,j]<>'#' then write(c[i,j])
     else write('#');
     writeln;
  end;
end.


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


int main(){
  string s;
  int i,sum,num;
  cin >> s;
  sum=0;
  num=0;
  for(i=0;i<s.size();++i){
    if(s[i]!='A' && s[i]!='G' && s[i]!='C' && s[i]!='T' ){
      num=0;
    }else{
      num=num+1;
      sum=max(sum,num);
    }
  }
  cout << sum << endl;
  return 0;
}


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

int main(){
	int n,ans=0;
	cin>>n;
	map<int,int>mp;
	for(int i=0;i<n;++i){
		int a;
		cin>>a;
		mp[a]++;
	}
	for(auto x:mp){
		if(x.second%2)ans++;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 4992
N = int(input())
A = list(map(int, input().split()))

A.sort()
if N % 2 == 0:
    B = list(range(1, N, 2)) * 2
else:
    B = [0] + list(range(2, N, 2)) * 2
B.sort()

if A != B:
    print(0)
else:
    result = 1
    for i in range(N // 2):
        result *= 2
        result %= 1000000007
    print(result)

Measured memory_bytes: 13880
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int r=sc.nextInt();
    int g=sc.nextInt();
    int b=sc.nextInt();
    int n=sc.nextInt();
    int count=0;
    
    for(int i=0;i<=n/r;i++){
      for(int j=0;j<=n/g;++j){
          if(n>=r*i+g*j && (n-r*i-g*j)%b==0) count++;
      }
    }
    System.out.print(count);
  }
}


Measured memory_bytes: 21844
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
typedef long long ll;


ll counttwo(ll n){
	ll ans = 0;
  	while(1){
		if(n%2==0) {
          	n /= 2;
          	ans++;
        }
      	else{
        	return ans;
        }
    }
}
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;
}
ll lcm_s_v(vector<int> v){
	int n = v.size();
  	ll ans = v[0];
  	rep(i,n-1) {
      	if(counttwo(ans) != counttwo(v[i+1])) return 0;
      	ans = lcm(ans, v[i+1]);
    }
  	return ans;
}

void Main()
{
  	int N, M;
  	cin >> N >> M;
  	vector<int> a(N);
  	rep(i,N) {
      	cin >> a[i];
  		a[i] /= 2; 
    }
  	ll lcma = lcm_s_v(a);
  	if(lcma == 0) {
      	cout << 0 << endl;
  		return;
	}
  	// lcma の 1 倍, 3 倍, 5 倍... で M 以下のものがいくつあるか？	
  	ll ans = M/lcma;
  	if(ans%2 == 1) cout << (ans+1)/2 << endl;
   	else cout << ans/2 << endl;
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}

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

int digitsum(int N){
  int ds=0;
  while(N>0){
    ds+=N%10;
    N/=10;
  }
  return ds;
}

int main() {
  int a,b,t;
  cin >>a>>b>>t;

  cout <<b*(t/a)<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define All(a) a.begin(),a.end()
#define INF 1000000007
const int MOD = 1000000007;
//accumulate(vec.begin(), vec.end(), 0)

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

int main(){
  int a,b;
  cin >> a >> b;
  for(int i=1;i<=1000;i++){
    if(int(i*0.08)==a && int(i*0.1)==b){
      cout<< i <<endl;
      return 0;
    }
  }
  cout<< -1 <<endl;
}


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-1;i>=0;i--)
#define MAX(a,b) a=a>b?a:b
#define MIN(a,b) a=a<b?a:b
#define REP(i,x,n) for(int i=x;i<n;i++)
#define REPR(i,x,n) for(int i=n-1;i>=x;i--)
#define pb  push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLr(obj) (obj).rbegin(), (obj).rend()
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const double PI=3.14159265358979323846;
ll dp;

int main(){
   ll n,m,z,ne;;
   cin>>n>>m;
   
   if(m%2==0){
      z=m,ne=1+m;
   }else{
      z=m+1,ne=m+2;
   }
   
      int i=1;
      while(z>i){
         cout<<i<<" "<<(z)<<endl;
         i++;z--;
      }
      
      z=ne;
      i=ne;
      z=ne+m-(m%2);
      while(z>i){
         cout<<i<<" "<<z<<endl;
         i++;z--;
      }
      
   
}


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

#define ll long long

int main(void){
    int n,k; cin >>n >> k;
    vector<ll>a(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    sort(a.begin(),a.end());
    int cnt = count(a.begin(),a.end(),a[0]);
    cout << (a.size()-cnt+k-2)/(k-1) << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll BigN = 1000000000000000000LL;
ll arr[200001];
int main(){
	ll N,K;
	scanf("%lld %lld",&N,&K); //k번째로 작은 숫자
	for(int i=0;i<N;i++) scanf("%lld",arr+i);
	sort(arr,arr+N);
	ll L=-BigN, R=BigN;
	while(L<R){
		ll mid = ((R-L)/2) + L;
		ll low=0,high=0;
		for(int i=0;i<N;i++){
			if(arr[i]==0){
				if(mid>0){
					low += N-1-i;
				}
				else if(mid<0){
					high += N-1-i;
				}
			}
			else{
				ll x = mid/arr[i];
				ll left,right;
				if(x*arr[i] == mid){
					right = x;
					left = x-1;
				}
				else{
					for(ll t=-1;t<=1;t++){
						if(((x+t)*arr[i]<mid)^((x+t+1)*arr[i]<mid)){
							left = x+t;
							right = x+t;
							break;
						}
					}
				}
				ll ub = upper_bound(arr,arr+N,right)-arr;
				ll lb = upper_bound(arr,arr+N,left)-arr;
				if(arr[i]>0){
					high += max(0LL,min(N-ub,N-1-i)); //arr[i]*arr[ub~N-1]
					low += max(0LL,lb-1-i); //arr[i]*arr[i+1~lb-1]
				}
				else{
					low += max(0LL,min(N-ub,N-1-i)); //arr[i]*arr[ub~N-1]
					high += max(0LL,lb-1-i); //arr[i]*arr[i+1~lb-1]
				}
				
			}
		}
		if(high>N*(N-1)/2-K) L=mid+1;
		else if(low>K-1) R=mid-1;
		else break;
		//printf("%lld %lld %lld\n",low,high,mid);
	}
	printf("%lld",((R-L)/2) + L);
	
}


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

int main() {
    string S,T; cin >> S >> T;
    int NS=S.size();
    int NT=T.size();
    int ans=1000000;
    for(int i=0; i<NS-NT+1; i++){
        int cnt=0;
        for(int j=0; j<NT; j++){
            if(S.at(i+j)!=T.at(j)) cnt++;
        }
        ans=min(ans,cnt);
    }
    cout << ans << endl;
}

    

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

using namespace std;
using ll = long long;

int n, m;
vector<vector<int>> to, ot;
vector<int> top, seen;

void dfs(int v) {
    if(seen[v])return;
    seen[v] = true;
    for(auto i : to[v])dfs(i);
    top.push_back(v);
}


int main()
{
    cin >> n >> m;
    to.resize(n), ot.resize(n), seen.resize(n);

    for(int i = 0; i < m + n - 1; i++) {
        int a, b; cin >> a >> b; a--, b--;
        to[a].push_back(b);
        ot[b].push_back(a);
    }
    for(int i = 0; i < n; i++)dfs(i);

    reverse(top.begin(), top.end());
    for(auto i : top) cerr << i << " : ";
    cerr << endl;
    map<int,int> mp;
    for(int i = 0; i < n; i++)mp[top[i]] = i;

    for(int i = 0; i < n; i++) {
        int naind = -1, nax = -1;

        for(auto j : ot[i]) {
            if(mp[j] > naind) {
                naind = mp[j];
                nax = j;
            }
        }
        cout << nax + 1 << endl;
    }


}

Measured memory_bytes: 20348
#include <stdio.h>
#include <string.h>
int main(void){
	int n,m,i;
	int num=1;
	scanf("%d",&n);
	scanf("%d",&m);
	for(i=0;i<n;i++){
		if(num*2<num+m){
			num*=2;
		}else{
			num+=m;
		}
	}
	printf("%d",num);
	return 0;
}

Measured memory_bytes: 128
#include<cstdio>
#include<math.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<set>
#include<cstring>
#include<map>
 
 
using namespace std;
#define int long long int
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define mp make_pair
#define pb push_back
#define mod 1000000007

int N,K;
signed main(){
    scanf("%lld %lld",&N,&K);
    int ans=N;
    if(N>K)ans=N%K;
    if(2*ans>K)ans=K-ans;
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 128
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush
import collections
import bisect

def main():
    W = input()

    c = collections.Counter(W)
    for key in c.keys():
        if c[key] % 2 != 0:
            print('No')
            return
    print('Yes')


if __name__ == '__main__':
    main()


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

int main(void) {
  
    using namespace std;
  
  int N;
  cin >> N;
  vector<int> x(4);
  
  for(int i=0; i<N; i++) {
    
    string s;
    cin >> s;
    
    if(s == "P"){
      x[0]++;
    }
    if(s == "Y"){
      x[1]++;
    }
    if(s == "W"){
      x[2]++;
    }
    if(s == "G"){
      x[3]++;
    }
  }
  
  int j=0;
  
  for (int i=0; i<4; i++) {
    if(x[i] != 0) j++;
  }
  
  if(j==3) cout << "Three" << endl;
  if(j==4) cout << "Four" << endl;
  
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt() - 1;
		int b = sc.nextInt() - 1;
		int c = sc.nextInt() - 1;
		int d = sc.nextInt() - 1;

		char[] str = sc.next().toCharArray();

		if(a > c || b > d){
			System.out.println("No");
			return;
		}
		else {
			for(int i = a; i < c;){
				if(str[i + 1] == '.'){
					i++;
				}
				else if(str[i + 2] == '.'){
					i += 2;
				}
				else {
					System.out.println("No");
					return;
				}
			}


			for(int i = b; i < d;){
				if(str[i + 1] == '.'){
					i++;
				}
				else if(str[i + 2] == '.'){
					i += 2;
				}
				else {
					System.out.println("No");
					return;
				}
			}
			boolean enoughSpace = false;
			for(int i = b; i <= d; i++){
//				System.out.println("I = "+i);
				if(i >= 1 && i < n - 1 && str[i - 1] == '.' && str[i] == '.' && str[i + 1] == '.'){
					enoughSpace = true;
				}

			}
			if(c > d && !enoughSpace){
				System.out.println("No");
				return;
			}
			else {
				System.out.println("Yes");
				return;
			}
		}
	}
}

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

namespace ABC126
{
    class C
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            double N = double.Parse(input[0]);
            double K = double.Parse(input[1]);

            double d = 0;
            double point = 0;
            for (double i = 1; i <= N; i++)
            {
                point = i;
                for (double j = 0; j <= 17; j++)
                {
                    if (K <= point)
                    {
                        d += ((1 / N) * Math.Pow(0.5, j));
                        break;
                    }
                    point = point * 2.0;
                }
            }
            Console.WriteLine(d);
        }
    }
}


Measured memory_bytes: 11220
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <set>
#include <map>
#include <unordered_map>
#include <vector>
#include <queue>
#include <string>
#include <iomanip>
#include <stdio.h>
#include <cstring>
#include <random>
#include <chrono>
#include <bitset>
#include <fstream>
#include <sstream>

using namespace std;

typedef long long ll;
typedef long double ld;

ll big = 1000000007ll;
float likeabutterfly;
string likeabee;
ll n,m,q,h,k,w;
ll T;

ll mod(ll i){
if(i < 0)return mod(i+big*big);
if(i < big)return i;
return i%big;
}

ll upp(ll i, ll j){
if(j == 0)return 1;
if(j%2 == 0){
    ll h = upp(i,j/2);
    return mod(h*h);
}
return mod(i*upp(i,j-1));
}


set<ll> S1;
set<ll> S2;

vector<ll> A;
vector<ll> B;

vector<ll> A2;
vector<ll> B2;

bool inbounds(ll i, ll j){
return( i >= 0 && j >= 0 && i < n && j < m);
}

bool inbounds2(ll i, ll j){
return( i >= 1 && j >= 1 && i < n-1 && j < m-1);
}

int main()
{
    ll c1,c2,c3,c4,c5,c6;
    ll a,b,d,e,g;
    ll x,y,z;
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);


    cin >> n >> m >> k;

    ll ANS[10] = {0};
    ll totans = 0;

    for(c1 = 0; c1 < k; c1++){
        cin >> a >> b;
        a--;
        b--;
        A.push_back(a);
        B.push_back(b);
        S1.insert(a*1000000000 + b);

        for(c2 = a-1; c2 <= a+1; c2++){
            for(c3 = b-1; c3 <= b+1; c3++){
                d = c2 * 1000000000 + c3;
                if(inbounds2(c2,c3) && (S2.find(d) == S2.end())){
                    S2.insert(d);
                    totans++;
                    A2.push_back(c2);
                    B2.push_back(c3);

                }
            }
        }

    }

    ANS[0] = (n-2)*(m-2) - totans;

    for(c1 = 0; c1 < A2.size(); c1++){
        ll j = 0;
        for(c2 = A2[c1]-1; c2 <= A2[c1]+1; c2++){
            for(c3 = B2[c1]-1; c3 <= B2[c1]+1; c3++){
                d = c2 * 1000000000 + c3;
                if(inbounds(c2,c3) && (S1.find(d) != S1.end())){
                    j++;
                }
            }
        }
        ANS[j]++;

    }

    for(c1 = 0; c1 < 10; c1++){
        cout << ANS[c1] << "\n";
    }

	return 0;
}



Measured memory_bytes: 62800
n,m = [int(x) for x in input().split()]
a = []
b = []
for _ in range(n):
    a.append(input())
for _ in range(m):
    b.append(input())


ans = False
for i in range(n-m+1):
    for j in range(n-m+1):
        tmp = True
        for y in range(m):
            for z in range(m):
                tmp &= a[i+y][j+z] == b[y][z]
        if tmp:
            ans = True
if ans:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<utility>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

int main(){
	string s;
	cin >> s;
	while(s.size()){
		if(s.rfind("dream") == s.size()-5 && s.size() >= 5)
			s.erase(s.size()-5, 5);
		else if(s.rfind("dreamer") == s.size()-7 && s.size() >= 7)
			s.erase(s.size()-7, 7);
		else if(s.rfind("erase") == s.size()-5  && s.size() > 4)
			s.erase(s.size()-5, 5);
		else if(s.rfind("eraser") == s.size()-6  && s.size() > 5)
			s.erase(s.size()-6, 6);
		else
			break;
	}
	if(s.size())
		cout << "NO" << endl;
	else
		cout << "YES" << endl;
	return 0;
}

Measured memory_bytes: 512
import java.math.BigInteger;
	import java.util.Scanner;
	
	class Main {
		public static void main(String args[]) {
			Scanner sc = new Scanner(System.in);
			int w = sc.nextInt();
			int h = sc.nextInt();
			int n = sc.nextInt();
			
			int[][] list = new int[n][3];
			for (int i = 0; i < n; i++) {
				list[i][0] = sc.nextInt();
				list[i][1] = sc.nextInt();
				list[i][2] = sc.nextInt();
			}
			
			int x1 = 0;
			int x2 = w;
			int y1 = 0;
			int y2 = h;
			for (int i = 0; i < list.length; i++) {
				int temp = list[i][2];
				switch (temp) {
				case 1:
					x1 = Math.max(x1, list[i][0]);
					break;
				case 2:
					x2 = Math.min(x2, list[i][0]);
					break;
				case 3:
					y1 = Math.max(y1, list[i][1]);
					break;
				case 4:
					y2 = Math.min(y2, list[i][1]);
					break;
				}
			}
			
			if (x2 <= x1 || y2 <= y1) {
				System.out.println(0);
			} else {
				
				System.out.println((x2 - x1) * (y2 - y1));
				
			}
			
			
		}
	}

Measured memory_bytes: 23764
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while (0)
#endif
#include<cassert>

using namespace std;

typedef long long LL;
typedef vector<int> VI;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
template<class Iter> void rprintf(const char *fmt, Iter begin, Iter end) {
    for (bool sp=0; begin!=end; ++begin) { if (sp) putchar(' '); else sp = true; printf(fmt, *begin); }
    putchar('\n');
}

LL A, B, N;

void MAIN() {
    scanf("%lld%lld%lld", &N, &A, &B);
    if (A > B) swap(A, B);
    LL ans = N;
    if (A % 2 == B % 2) {
	amin(ans, (B-A)/2);
    } else {
	A--; B--;
	amin(ans, A + 1 + (B-A-1)/2);
	A++; B++;
	A = N-A;
	B = N-B;
	swap(A, B);
	amin(ans, A + 1 + (B-A-1)/2);
    }
    printf("%lld\n", ans);
}

int main() {
    int TC = 1;
//    scanf("%d", &TC);
    REP (tc, TC) MAIN();
    return 0;
}



Measured memory_bytes: 256
url = "https://atcoder.jp//contests/abc116/tasks/abc116_b"

def calc(n):
    if n % 2 == 0:
        return n // 2
    else:
        return 3 * n + 1


def main():
    s = int(input())
    ans = [s]
    while True:
        tmp = calc(ans[-1])
        ans.append(tmp)
        if ans.index(tmp) != len(ans)-1:
            print(len(ans))
            break



if __name__ == '__main__':
    main()


Measured memory_bytes: 9160
import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
		int q=sc.nextInt();
  	   	int[] a=new int[q];
  		int[] b=new int[n];
		for(int c=0;c<q;c++){
    		a[c]=sc.nextInt();
    	}
  		
  		
  		for(int d=0;d<q;d++){
          	b[a[d]-1]++;
        }
          
    	for(int f=0;f<n;f++){
 		if((k-q+b[f])<=0){
    		System.out.println("No");
    	}else{
     		System.out.println("Yes");
   	 }

        }
    }
}


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


int main() {
	
	int N, M;
	cin >> N >> M;
	vector<int> r(N,0);
	for(int i=0; i<M; i++){
		int a, b;
		cin >> a >> b;
		r.at(a-1)++;
		r.at(b-1)++;
	}
	for (auto i : r) cout << i << endl;
	
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  int n;
  cin >> n;
  vi p(n);
  rep(i, n) cin >> p[i];
  int ans = 0;
  rep(i, n) if(i + 1 == p[i]) {
    ans++;
    i++;
  }
  cout << ans << endl;
}

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

   typedef long long ll;
   typedef pair<ll, ll> Pii;
   typedef vector<ll> Vi;
   typedef vector<Vi> VVi;

   const double EPS = (1e-7);
   const ll INF =(1e13);
   const double PI = (acos(-1));
   const ll MOD = ll(1e9) + 7;

   #define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
   #define REPR(i, n) for(ll i = n; i > -1; i--)
   #define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
   #define ALL(x) (x).begin(),(x).end()
   #define SORT(x) sort((x).begin(), (x).end())
   #define RSORT(x) sort((x).rbegin(), (x).rend())
   #define REVERSE(x) reverse((x).begin(), (x).end())
   #define SZ(x) ((ll)(x).size())
   #define pb push_back
   #define mp make_pair

   //chmax(a, b): a>bならaをbで更新　更新したときにtrueを返す
   //chmin(a, b): a<bならaをbで更新　更新したときにtrueを返す
   template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
   template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

   #define dump(x) cerr<< #x << "= " << (x) << endl;

   ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
   ll pow(ll a, ll b){if (b == 0) return 1; else if (b % 2 == 0) return pow(a * a, b / 2); else return pow(a * a, b / 2) * a;}
   ll pow(ll a, ll b, ll m){if (b == 0) return 1; else if (b % 2 == 0) return (pow(a * a, b / 2, m) % m); else return (pow(a * a, b / 2) * a) % m;}
   ll residue(ll a, ll m){return ((a % m) + m) % m;};

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

int main(){
  ll N; cin >> N;
  ll ans = INF;
  for(ll x = 1; x * x <= N; x++){
    if(N % x == 0) {
      string s = to_string(N / x);
      chmin(ans, (ll)s.size());
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007
#define INF 1e9
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()

vector<vector<ll>> g;
vector<ll> depth;
bool flag=false;

void dfs(int pos,int dep){
    if(depth[pos]>=0){
        if(depth[pos]!=dep) flag=true;
        return;
    }
    depth[pos]=dep;
    for(auto x : g[pos]) dfs(x,dep^1);
}

int main(){
    int n;
    cin>>n;
    vector<string> s(n);
    rep(i,n) cin>>s[i];

    vector<vector<ll>> dist(n,vector<ll>(n,INF));
    g.resize(n);
    rep(i,n){
        rep(j,n){
            if(s[i][j]=='1'){
                g[i].push_back(j);
                dist[i][j]=1;
            }
        }
    }

    depth.resize(n,0);
    rep(i,n) depth[i]=-1;
    dfs(0,0);

    if(flag){
        puts("-1");
        return 0;
    }

    rep(i,n) dist[i][i]=0;
    rep(k,n)rep(i,n)rep(j,n) dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j]);
    ll ans=0;
    rep(i,n) ans=max(ans,*max_element(all(dist[i])));
    cout<<ans+1<<endl;
}

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

const int LIMIT = 31;

int main()
{
	int dp[ LIMIT ][ LIMIT ] = {0};
	int ans[ LIMIT ] = {0};

	dp[ 0 ][ 0 ] = 1;

	for( int i = 1; i < LIMIT; ++i ){
		for( int j = 0; j < 3; ++j ){
			for( int k = 0; k < i * 2 - 1; ++k ){
				int p = i + j + k;
				if( p >= LIMIT ) continue;
				dp[ i ][ p ] += dp[ i - 1 ][ i - 1 + k ];
				ans[ p ] += dp[ i - 1 ][ i - 1 + k ];
			}
		}
	}

	int n;
	while( cin >> n && n ){
		cout << ans[ n ] / 3650 + ( ans[ n ] % 3650 > 0 ? 1 : 0 ) << endl;
	}

	return 0;
}

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

int main() {
  string s; cin >> s;
  rep(i, s.size()) {
    s[i] = 'x';
  }
  cout << s << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MAX 2000005
#define MOD 1000000007
#define MOD2 998244353
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define vi vector<ll>
#define vp vector<pii>
#define all(v) v.begin(),v.end()
#define sz(x) (ll)x.size()
#define F first
#define S second
#define FOR(i,a,b) for(ll i=a;i<b;++i)
#define ROF(i,a,b) for(ll i=a;i>=b;--i)
#define trace(x) cerr<<#x<<": "<<x<<'\n';
typedef long long ll;
using namespace std;
//using namespace __gnu_pbds;
//#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

ll mexp(ll a, ll b){
    ll ans=1;
    a%=MOD;
    while(b){
        if(b&1) ans=ans*a%MOD;
        b>>=1;
        a=a*a%MOD;
    }
    return ans;
}

int main(){
    IOS

    int a,b,x;
    cin>>a>>b>>x;
    if(x>=a && x<=(a+b)){
        cout<<"YES";
    }
    else{
        cout<<"NO";
    }

    cerr<<"Time: "<<1.0/CLOCKS_PER_SEC<<" ms"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <cmath>
#define ll long long
#define INF 10000000000000000
#define MOD 1000000007
using namespace std;


int main(){
    int N;
    
    cin >> N;
    
    ll ans=-N;
    for(int i=0; i<N; i++){
        ll a;
        cin >> a;
        ans+=a;
    }
    
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
//config = { input: 'tmp', newline: '\r\n' }; // win
config = { input: '/dev/stdin', newline: '\n' }; // linux

M = require('fs').readFileSync(config.input, 'ascii')
  .trim()
  .split(config.newline);
M = M.map(
  function (line) {
    return line.split(' ').map(Number);
  });
n = M[0][0];

min = {};
for (i = 1; i <= n; i++) min[i] = {};
for (i = 1; i <= n; i++) min[i][i] = 0;
for (i = 1; i < n; i++) {
  for (j = 1, k = 1 + i; k <= n; j++, k++) {
    min[j][k] = Number.MAX_VALUE;
    for (l = j; l < k; l++) {
      min[j][k] = Math.min(
        min[j][k],
        M[j][0] * M[l][1] * M[k][1] + min[j][l] + min[l+1][k]);
    }
  }
}
console.log(min[1][n]);

Measured memory_bytes: 18028
dx=[0,0,-1,1]
dy=[-1,1,0,0]
    
def curling(x,y,cnt):
    '''
    Map: map
    si,sj: start(x,y)
    cnt: count
    '''
    global Map
    global ans
    if (cnt>=ans):return
    
    for i in range(4):
        mx=x; my=y
        mx+=dx[i]; my+=dy[i]
        if(mx<0 or mx>=w or my<0 or my>=h):continue
        if(Map[my][mx]==1):continue

        while(True):
            if(Map[my][mx]==3):
                ans=cnt
                return
        
            mx+=dx[i]; my+=dy[i]
            if(mx < 0 or mx>=w or my < 0 or my >=h):break
            
            if(Map[my][mx]==1):
                Map[my][mx]=0
                curling(mx-dx[i],my-dy[i],cnt+1)
                Map[my][mx]=1
                break            
            
while(True):
    Map=[]
    w,h=map(int,raw_input().split(' '))
    if (w==0 and h==0):break
    for i in range(h):
        Map.append(map(int,raw_input().split(' ')))

    for y in range(h):
        for x in range(w):
            if (Map[y][x]==2):break
        else:continue
        break

    ans =11
    curling(x,y,1)
    print ans if ans < 11 else -1

Measured memory_bytes: 6276
#define _GLIBCXX_DEBUG
#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;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;


int main(){
  ll n,m; cin >> n >> m; string s; cin >> s; reverse(all(s));
  ll now = 0; bool flag = true;
  stack<ll> num;

  while(flag){
    if(now == n) break; 
    
    flag = false;
    
    for(ll i=m; i > 0; i--){
      if(now + i <= n){
        if(s.at(now + i) == '0'){
        	num.push(i);
            now += i;
        	flag = true;
        	break;
        }
      }
    }
    
    if(!flag){
      cout << -1 << endl;
    }
  }
 
  if(flag){
    while(!num.empty()){
      cout << num.top() << ' ';
      num.pop();
    }
  }
}


Measured memory_bytes: 1212
#include<queue>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
short b[52][52][52][52];
int main(){
  int i,j;
  int a[52][52],sx,sy,tx,ty,tm,w,h;
  queue<pair<pair<pair<int,int>,pair<int,int> >,int> > q;
  while(cin>>w>>h&&w+h){
    cin>>sx>>sy>>tx>>ty;
    memset(a,-1,sizeof(a));
    for(i=1;i<h+1;i++){
      for(j=1;j<w+1;j++){
	cin>>a[j][i];
	a[j][i]=-a[j][i];
      }
    }
    memset(b,-1,sizeof(b));
    while(q.empty()==0)
      q.pop();
    q.push(make_pair(make_pair(make_pair(sx,sy),make_pair(tx,ty)),0));
    while(q.empty()==0){
      sx=q.front().first.first.first;
      sy=q.front().first.first.second;
      tx=q.front().first.second.first;
      ty=q.front().first.second.second;
      tm=q.front().second;
      if(tm>100)
	break;
      if(sx==tx&&sy==ty)
	break;
      q.pop();
      if(b[sx][sy][tx][ty]==-1){
	b[sx][sy][tx][ty]=tm;
	q.push(make_pair(make_pair(make_pair(sx-(a[sx-1][sy]?0:1),sy),make_pair(tx+(a[tx+1][ty]?0:1),ty)),tm+1));
	q.push(make_pair(make_pair(make_pair(sx+(a[sx+1][sy]?0:1),sy),make_pair(tx-(a[tx-1][ty]?0:1),ty)),tm+1));
	q.push(make_pair(make_pair(make_pair(sx,sy-(a[sx][sy-1]?0:1)),make_pair(tx,ty+(a[tx][ty+1]?0:1))),tm+1));
	q.push(make_pair(make_pair(make_pair(sx,sy+(a[sx][sy+1]?0:1)),make_pair(tx,ty-(a[tx][ty-1]?0:1))),tm+1));
      }
    }
    if(q.empty()||tm>100)
      cout<<"NA"<<endl;
    else
      cout<<tm<<endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
#include<complex>
#include <cassert>

using namespace std;

#define ll long long
#define ld long double
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

const double PI=acos(-1);
const double EPS=1e-9; //うまくいかなかったらゆるめる

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef pair<int,pii> pip;
typedef vector<pii> vp;
typedef vector<vi> vvi;

int gcd(int a, int b){if(b==0) return a;return gcd(b,a%b);}
int lcm(int a, int b){return a/gcd(a,b)*b;}


signed main(void) {
    int n,m,k;
    cin >> n >> m >> k;
    vi a(n+1,0),b(m+1,0);
    rep(i,n)cin >> a[i+1];
    rep(i,m)cin >> b[i+1];
    rep(i,n)a[i+1] += a[i];
    rep(i,m)b[i+1] += b[i];
    int ans = 0;
    rep(i,n+1){
        int tmp = upper_bound(all(b),k-a[i]) - b.begin()-1;
        //cout << i << " " << tmp << " " << a[i] << " " << b[tmp] << endl;
        if(tmp >= 0)ans = max(ans, i+tmp);
    }
    cout << ans << endl;
}


Measured memory_bytes: 6336
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<functional>
#include<numeric>
#include<queue>
#include<stack>
#include<map>
#include<unordered_map>
#include<set>
#include<bitset>
#include<random>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define rep(i,n) FOR(i,0LL,n)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define rrep(i,n) RFOR(i,0LL,n)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define COUNT(a,y,x) upper_bound(all(a), y) - lower_bound(all(a), x)
#define UNIQUE(a) sort(all(a)); a.erase(unique(all(a)), a.end())
#define pb push_back
#define endl '\n'
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef map<ll, ll> MAP;
const ll inf = 2222222222222222222LL;
const ll mod = 1000000007LL;

ll n = 0, m = 0, ans = 0, tmp = 0, ma = -inf, mi = inf;
string s;
bool ok;
ll dx[9] = { 0,1,-1,0,0,1,1,-1,-1 }, dy[9] = { 0,0,0,1,-1,1,-1,1,-1 };
#pragma endregion
#define MAX 222222


ll a[11];


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


  rep(i, 4) {
    cin >> tmp;
    a[tmp]++;
  }
  if (a[1] && a[9] && a[7] && a[4]) cout << "YES" << endl;
  else cout << "NO" << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,ans=0;
    cin >> n;
    int l[n];
    for(int i=0;i<n;i++){
        cin >> l[i];
    }
    sort(l,l+n);
    for(int i=0;i<n-1;i++){
        ans = ans + l[i];
    }
    if(ans>l[n-1]) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3572