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

using namespace std;

#define EPS 1e-10
#define equal(a,b) (fabs(a-b) < EPS)
#define lt(a,b) (a-b < -EPS)

struct Point{
  double x,y;

  Point(){}
  Point(double x,double y) : x(x),y(y) {}

  Point operator + (const Point &p)const{ return Point(x+p.x,y+p.y); }
  Point operator - (const Point &p)const{ return Point(x-p.x,y-p.y); }
  Point operator * (const double &k)const{ return Point(x*k,y*k); }
  Point operator / (const double &k)const{ return Point(x/k,y/k); }
  bool operator < (const Point &p)const{ return x != p.x ? x < p.x : y < p.y; }
};

double dot(const Point &a,const Point &b){ return a.x*b.x+a.y*b.y; }
double cross(const Point &a,const Point &b){ return a.x*b.y - b.x*a.y; }
double norm(const Point &p){ return dot(p,p); }
double abs(const Point &p){ return sqrt(norm(p)); }

istream &operator >> (istream &is,Point &p){ 
  return is >> p.x >> p.y;
}

typedef Point Vector;

struct Line{
  Point s,t;
  Line(){}
  Line(Point s,Point t) : s(s),t(t) {}
};

bool isIntersectLL(const Line &a,const Line &b){
  return abs(cross(a.t-a.s,b.t-b.s)) > EPS
    || abs(cross(a.t-a.s,b.t-b.s)) < EPS;
}

Point crosspointLL(const Line &a,const Line &b){
  Vector va = a.t-a.s, vb = b.t-b.s;
  double d = cross(vb,va);
  return a.s+va*cross(vb,b.t-a.s)*(1.0/d);
}

int main(){
  int N;
  while(cin >> N,N){
    vector<Line> l(N);
    for(int i = 0 ; i < N ; i++){
      cin >> l[i].s >> l[i].t;
    }
    int div = 1;
    for(int i = 0 ; i < N ; i++){
      int cp = 0;
      vector<Point> used;
      for(int j = 0 ; j < i ; j++){
        if(isIntersectLL(l[i],l[j])){
          Point p = crosspointLL(l[i],l[j]);
	  bool flg = false;
          for(int k = 0 ; k < (int)used.size() ; k++){
	    Point q = used[k];
	    if(equal(p.x,q.x) && equal(p.y,q.y)){
	      flg = true;
	      break;
	    }
	  }
	  if(flg){ continue; }
	  used.push_back(p);
          if(lt(-100,p.x) && lt(p.x,100) &&
             lt(-100,p.y) && lt(p.y,100)){
            cp++;
          }
        }
      }
      div += cp+1;
    }
    cout << div << endl;
  }
  return 0;
}

Measured memory_bytes: 1240
#include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, accumulate, inner_product
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <stack> // stack
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <unordered_map> // hashed by keys
#include <unordered_set> // hashed by keys
#include <iomanip> // cout<<setprecision(n)

#define rep(i,n) for(int i = 0; i < n; i++)
#define ENDL "\n"
#define print(i) std::cout << (i) << "\n"

#define int long long // at least int64 > 9*10^18
#define all(v) v.begin(), v.end()

template<typename T,T MOD = 1000000007>
struct Mint{
  T v;
  Mint():v(0){}
  Mint(signed v):v(v){}
  Mint(long long t){v=t%MOD;if(v<0) v+=MOD;}

  Mint pow(long long k){
    Mint res(1),tmp(v);
    while(k){
      if(k&1) res*=tmp;
      tmp*=tmp;
      k>>=1;
    }
    return res;
  }
  
  static Mint add_identity(){return Mint(0);}
  static Mint mul_identity(){return Mint(1);}
  
  Mint inv(){return pow(MOD-2);}
  
  Mint& operator+=(Mint a){v+=a.v;if(v>=MOD)v-=MOD;return *this;}
  Mint& operator-=(Mint a){v+=MOD-a.v;if(v>=MOD)v-=MOD;return *this;}
  Mint& operator*=(Mint a){v=1LL*v*a.v%MOD;return *this;}
  Mint& operator/=(Mint a){return (*this)*=a.inv();}
  
  Mint operator+(Mint a) const{return Mint(v)+=a;};
  Mint operator-(Mint a) const{return Mint(v)-=a;};
  Mint operator*(Mint a) const{return Mint(v)*=a;};
  Mint operator/(Mint a) const{return Mint(v)/=a;};

  Mint operator-() const{return v?Mint(MOD-v):Mint(v);}

  bool operator==(const Mint a)const{return v==a.v;}
  bool operator!=(const Mint a)const{return v!=a.v;}
  bool operator <(const Mint a)const{return v <a.v;}
  
  static Mint comb(long long n,int k){
    Mint num(1),dom(1);
    for(int i=0;i<k;i++){
      num*=Mint(n-i);
      dom*=Mint(i+1);
    }
    return num/dom;
  }
  static Mint expon(long long n) {
	  Mint num(1);
	  for(int i=1;i<=n;i++) num*=i;
	  return num;
  }
};

signed main() {
	int n,k;
	std::cin >> n >> k;
	for(int i=1;i<=k;i++) {
		print((Mint<int>::comb(k-1,k-i)*Mint<int>::comb(n-k+1,i)).v);
	}
	return 0;
}


Measured memory_bytes: 256
void main(){
  import std.stdio, std.string, std.conv, std.algorithm;
  import std.array;
  
  auto expr=readln.chomp.to!(char[]);
  int res; rd(res);

  auto n=expr.length;
  int[] a; a~=(expr[0]-'0');
  for(auto i=1; i<n; i+=2){
    if(expr[i]=='+') a~=(expr[i+1]-'0');
    else{
      auto bk=a.back; a.popBack;
      a~=(bk*(expr[i+1]-'0'));
    }
  }
  auto res1=sum(a);

  int res2=(expr[0]-'0');
  for(auto i=1; i<n; i+=2){
    if(expr[i]=='+') res2+=(expr[i+1]-'0');
    else res2*=(expr[i+1]-'0');
  }
  
  if(res1==res2 && res1==res) writeln("U");
  else if(res1==res) writeln("M");
  else if(res2==res) writeln("L");
  else writeln("I");
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}
void wr(T...)(T x){
  import std.stdio;
  foreach(e; x) write(e, " ");
  writeln();
}

Measured memory_bytes: 2472
N,K = map(int,input().split())
A = list(map(int,input().split()))
max_bit = 40
ans = 0
for i in range(max_bit,-1,-1):
    bit = 2**i #xのi桁目を0にする
    c = len([1 for j in A if j&bit > 0]) #i桁目が1のビットの多数決
    if 2*c < N and bit <= K:#多数決に負けてかつx<Kの条件を満たすときxのi桁目を1にする
        c = N-c
        K -= bit
    ans += bit*c
print(ans)

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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<string> Vs;

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;}
template<class T> void YesNo(T a) {cout<<(a?"Yes":"No")<<endl;}
template<class T> void YESNO(T a) {cout<<(a?"YES":"NO")<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
void uniq(vector<int> &vec){sort(vec.begin(), vec.end());vec.erase(unique(vec.begin(), vec.end()), vec.end());}
void start(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);}

signed main(){start();
    int n,m;
    cin>>n>>m;
    Vi s(n),t(m);
    REP(i,0,n) cin>>s[i];
    REP(i,0,m) cin>>t[i];

    const int h=2010,w=2010;
    VVi dp(h,Vi(w,0)),sum(h,Vi(w,0));
    REP(i,1,n+1){
        REP(j,1,m+1){
            if (s[i-1]==t[j-1]) dp[i][j]=sum[i-1][j-1]+1;
            sum[i][j] =(sum[i-1][j]+sum[i][j-1]-sum[i-1][j-1]+dp[i][j])%MOD;
            if(sum[i][j]<0) sum[i][j]+=MOD;
        }
    }
    cout<<(sum[n][m]+1)%MOD<<endl;
    return 0;
}


Measured memory_bytes: 63616
#include<iostream>
#include<iomanip>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<queue>
#include<algorithm>
using namespace std;
int n,c;
double f[405][1<<6],t,ans=0;
int a[100005];
long long ksm(long long x,long long n)
{
	long long ans=1;
	while(n)
	{
		if(n&1) ans=ans*x;
		x=x*x;
		n>>=1;
	}
	return ans;
}
int main()
{
	scanf("%d%d",&n,&c);
	for(int i=0;i<n;i++) scanf("%d",&a[i]);
	sort(a,a+n);
	do
	{
		memset(f,0,sizeof(f));
		f[a[n-1]*n][0]=1;
		for(int i=0;i<=n*c;i++)
		for(int j=i;j<=n*c;j++)
		for(int s=0;s<(1<<(n-1));s++) if(i%n&&!((s>>(i%n-1))&1)) f[min(n*c,max(j,i+a[i%n-1]*n))][s|(1<<(i%n-1))]+=f[j][s];
		ans+=f[n*c][(1<<n-1)-1];
		t++;
	}while(next_permutation(a,a+n-1));
	printf("%.15lf",ans/t/ksm(c,n-1));
}

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

#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define vi vector<int>
#define VS vector<string>
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back

using namespace std;

int main(){
    double x, y, z;
    while(cin >> x >> y >> z, x+y+z){
        vector<double> v;
        v.push_back(x); v.push_back(y); v.push_back(z);

        sort(all(v));
        int n;
        cin >> n;
        for(int i=0; i < n; i++){
            double r;
            cin >> r;
            if(r*2 > sqrt(pow(v[0], 2)+pow(v[1], 2))) cout << "OK" << endl;
            else cout << "NA" << endl;
        }
    }
}

Measured memory_bytes: 1244
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
#include <cmath>
#include <unordered_map>
#include <cstdio>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long ll;

ll gcd(ll x, ll y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}
ll kai(ll x, ll y, ll m) {
	ll res = 1;
	for (ll i = x - y + 1; i <= x; i++) {
		res *= i; res %= m;
	}
	return res;
}
ll mod_pow(ll x, ll y, ll m) {
	ll res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

ll comb(ll x, ll y, ll m) {
	if (y > x)return 0;
	return kai(x, y, m) * mod_pow(kai(y, y, m), m - 2, m) % m;
}

int n, m, k;
ll cum1[200010], cum2[200010];
int ans;

signed main() {
	cin >> n >> m >> k;
	for (int i = 1; i <= n; i++) {
		int a; cin >> a;
		cum1[i] = cum1[i - 1] + a;
	}
	for (int i = 1; i <= m; i++) {
		int a; cin >> a;
		cum2[i] = cum2[i - 1] + a;
	}
	cum2[m + 1] = 1000000001;
	for (int i = 0; i <= n; i++) {
		if (k < cum1[i])continue;
		int x = upper_bound(cum2, cum2 + m + 1, k - cum1[i]) - cum2 - 1;
		ans = max(ans, i + x);
	}
	cout << ans << endl;
}

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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n,a,q,b,c,sum=0;
	cin>>n;
	vector<ll>v(1000000);
	for(ll i=0;i<n;i++){
		cin>>a;
		v[a]++;
		sum+=a;
	}
	cin>>q;
	for(ll i=0;i<q;i++){
		cin>>b>>c;
		int w;
		w=v[b];
		v[b]=0;
		v[c]+=w;
		sum=sum-(b*w)+(c*w);
		cout<<sum<<endl;
	}
	return 0;
}


Measured memory_bytes: 11120
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <utility>
#include <map>
#include <bitset>
#include <numeric>
#define ll long long
using namespace std;
using p = pair<ll, ll>;
ll dx[8]={ 0, 1, 0,-1, 1, 1,-1,-1}; // x軸方向への変位
ll dy[8]={ 1, 0,-1, 0, 1,-1, 1,-1}; // y軸方向への変位

int main(void) {
    ll n, k;
    cin >> n >> k;
    vector<ll> c(n+1, 0);
    for(ll i = 0; i < k; i++){
        ll a;
        cin >> a;
        for(ll j = 0; j < a; j++){
            ll b;
            cin >> b;
            c[b]++;
        }
    }
    ll ans = 0;
    for(ll i = 1; i <= n; i++)
        if(c[i]==0) ans++;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3636
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
template<class T>
class Bit{
public:
	vector<T> a;
	Bit(int n):a(n){
	}
	T operator[](int p){
		T sm=0;
		for(;p>=0;p=(p&p+1)-1)
			sm+=a[p];
		return sm;
	}
	void update(int p,T q){
		for(;p<(int)a.size();p|=p+1)
			a[p]+=q;
	}
};
struct S{
	int a,b;
	bool operator<(const S& p)const{
		return a<p.a;
	}
};
int main(){
	int i;
	int n;
	scanf("%d",&n);
	S a[300000];
	for(i=0;i<n;++i)
		scanf("%d%d",&a[i].a,&a[i].b);
	sort(a,a+n);
	Bit<long long> b(100000);
	Bit<int> c(100000);
	int mx=0;
	for(i=0;i<n;++i){
		b.update(100000-a[i].b,a[i].a);
		c.update(100000-a[i].b,1);
		int p=c[c.a.size()-1];
		while(b[b.a.size()-1]>(100001-b.a.size())*p){
			mx=max(mx,p-1);
			b.a.pop_back();
			c.a.pop_back();
			if(!b.a.empty())
				continue;
			printf("%d\n",mx);
			return 0;	
		}
	}
	for(i=0;i<(int)c.a.size();++i)
		mx=max(mx,c[i]);
	printf("%d\n",mx);
	return 0;
}

Measured memory_bytes: 4436
L, R = map(int, input().split())
L1 = L%2019
R1 = R%2019
L2 = L//2019
R2 = R//2019
if L2 != R2:#LとRの間に0でなるとき
  ans = 0
else:
  ans = (L*(L+1))%2019
  for i in range(L,R+1):
    for j in range(i+1,R+1):
      x = (i*j)%2019
      ans = min(ans,x)
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i, l, r) for (register int i = l; i <= r; i++)
#define per(i, r, l) for (register int i = r; i >= l; i--)
#define srep(i, l, r) for (register int i = l; i < r; i++)
#define sper(i, r, l) for (register int i = r; i > l; i--)
using namespace std;

int main(){
	char s[220];
	scanf("%s", s + 1);
	int n = strlen(s + 1);
	if (n & 1){
		printf("No");
		return 0;
	}
	for (register int i = 1; i <= n; i += 2) {
		if (s[i] != 'h') {
			printf("No");
			return 0;
		}
	}
	for (register int i = 2; i <= n; i += 2) {
		if (s[i] != 'i') {
			printf("No");
			return 0;
		}
	}
	printf("Yes");
	return 0;
}

Measured memory_bytes: 256
def get_ac(n,q,s,l,r):
    pos = [0]*n

    for j in range(0,n-1):
        if s[j] == 'A' and s[j+1] == 'C':
            pos[j+1] = pos[j] + 1
        else:
            pos[j+1] = pos[j]

    for i in range(q):
        left = l[i]
        right = r[i]
        count = pos[right - 1] - pos[left - 1]

        print count

if __name__ == '__main__':

    n,q = map(int,raw_input().split())
#    t1 = time.time()
    s = raw_input()

    l = [0]*q
    r = [0]*q

    for i in range(q):
        l[i],r[i] = map(int,raw_input().split())

#    t2 = time.time()
#    print('{0:.9f}'.format(t2 - t1))
    get_ac(n,q,s,l,r)

Measured memory_bytes: 15476
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <algorithm>
#include <vector>
#include <cstring>
#include <stack>
#include <cctype>
#include <utility>
#include <map>
#include <string>
#include <climits>
#include <set>
#include <sstream>
#include <utility>
#include <ctime>
#include <cassert>
#include <fstream>
using namespace std;
typedef long long LL;
#define MSV(A,a) memset(A, a, sizeof(A))
#define MP make_pair
#define PB push_back
#define INF (int(1e9))
#define INFL (LL(1e18))
#define EPS 1e-12
#define chkbit(s, b) (s & (1<<b))
#define setbit(s, b) (s |= (1<<b))
#define chk(a) cerr << endl << #a << " : " << a << endl
#define chk2(a,b) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << endl
#define chk3(a,b,c) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << endl
#define chk4(a,b,c,d) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << "\t" << #d << " : " << d << endl
#define rep(i, a, n) for(i=a;i<n;i++)
#define rev(i, a, n) for(i=a;i>=n;i--)
#define rep_itr(itr, c) for(itr = (c).begin(); itr != (c).end(); itr++)
#define MOD 1000000007
#define MAX 100005
#define in(x) scanf("%d", &x)
#define inl(x) scanf("%lld", &x)
#define in2(x, y) scanf("%d %d", &x, &y)
#define inl2(x, y) scanf("%lld %lld", &x, &y)
#define finish(x) {cout<<x<<'\n'; return;}
typedef pair<int, int> pi;
typedef pair<LL, LL> pl;
const char en = '\n';


void solve() {
	LL n, k;
	inl2(n, k);
	
	LL a[n];
	for(int i=0;i<n;i++) inl(a[i]);
	
	if(k == 0) {
		LL maxi = -1;
		for(int i=0;i<n;i++) maxi = max(maxi, a[i]);
		finish(maxi);
	}
	
	LL low=1, high=1e9 + 5, ans = 0;
	while(low <= high) {
		LL mid = (low+high) >> 1; //every log of max "mid" length
		LL cuts = 0;
		for(int i=0;i<n;i++) {
			if(a[i] >= mid) cuts += (a[i]/mid);
			if(a[i] > 0 && a[i] % mid == 0) cuts--;
		}
		
		if(cuts > k) {
			low = mid + 1;
		} else {
			ans = mid;
			high = mid - 1;
		}
	}
	
	cout<<ans<<en;
}

int main() {

	solve();
	return 0;
}

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

/*
int main(){
  //浮動小数点を含むと精度が足りない
  ll a,x,y,z;
  double b;
  cin >> a >> b;

  x = 100*b;
  y =(ll)x;

  z = (a*y)/100;

  cout << z << endl;

}*/

int main(){
  ll x;
  int y,z;
  scanf("%lld%d%*c%d",&x,&y,&z);
  x = x*(y*100+z);
  x/=100;
  printf("%lld\n",x);
  return 0;
}


Measured memory_bytes: 3804
//#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;

#include <iostream>
using namespace std;

int main() {
	int a;
	cin >> a;
	cout << a * (1 + a + a * a) << endl;
	return 0;
}

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

int main() {
  // Nの入力
  int H,A;
  cin >> H >> A;
  
  int result;
  
  result = H / A;
  
  if(H % A != 0) result += 1;
  
  cout << result << endl;

}


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

typedef struct pp{
    char name[100];
    int t;
} P;

P Q[LEN + 1];
int head, tail, n;
void enqueue(P x){
    Q[tail] = x;
    tail = (tail + 1) % LEN;
}

P dequeue(){
    P x = Q[head];
    head = (head + 1) % LEN;
    return x;
}
int main(){
    int elaps = 0, c;
    int i, q;
    P u;
    scanf("%d %d", &n, &q);

    for ( i = 1; i <= n; i++){
        scanf("%s", Q[i].name);
        scanf("%d", &Q[i].t);
    }
    head = 1;
    tail = n + 1;

    while(head!=tail){
        u = dequeue();
        c = fmin(q,u.t);
        u.t -= c;
        elaps += c;
        if(u.t>0)
            enqueue(u);
        else{
            printf("%s %d\n", u.name, elaps);
        }
    }
    return 0;
}



Measured memory_bytes: 13388
import sys
from collections import deque
K = int(input())

q = deque([str(i) for i in range(1, 10)])
cnt = 0
while True:
    if cnt == K-1:
        print(q.popleft())
        sys.exit()
    cnt += 1
    x = q.popleft()
    b = int(x[-1])
    if b > 0:
        q.append(x+str(b-1))
    q.append(x+str(b))
    if b < 9:
        q.append(x+str(b+1))


Measured memory_bytes: 17012
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
	long long n,m;
	char s1[100010],s2[100010];
long long gcd(long long x,long long y)
{
	return !y?x:gcd(y,x%y);
}
long long lcm(long long x,long long y)
{
	return x/gcd(x,y)*y;
}
int main()
{
	scanf("%lld %lld",&n,&m);
	scanf("%s",s1+1);
	scanf("%s",s2+1);
	long long LCM=lcm(n,m);
	if(s1[1]!=s2[1])
	{
		printf("-1");
		return 0;
	}
	if(gcd(n,m)==1)
	{
		printf("%lld",LCM);
		return 0;
	}
	long long t1=LCM/m,t2=LCM/n;
	long long i=1,j=1;
	while(i<=n&&j<=m)
	{
		if(s1[i]!=s2[j])
		{
			printf("-1");
			return 0;
		}
		i+=t1;
		j+=t2;
	}
	printf("%lld",LCM);
	return 0;
}

Measured memory_bytes: 384
#include <iostream>

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    if (a > b)
        cout << "a > b" << endl;
    else if (a < b)
        cout << "a < b" << endl;
    else if (a == b)
        cout << "a == b" << endl;

}


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

void solve(){  
	int k;cin>>k;
	int a,b;
	cin>>a>>b;
	for(int i=a;i<=b;i++)
	   if(i%k==0){
		    cout<<"OK\n";
		    return ;
	   }
	 cout<<"NG\n";
}
int main(){
	ios_base::sync_with_stdio(0); 
    cin.tie(0);
    cout.tie(0);
    solve();
  return 0;
}


Measured memory_bytes: 3596
type Stack = [Int]
type Result = [Int]

main :: IO ()
main = do
  c <- getContents
  let is = map read $ lines c
      res = proc is
  mapM_ (putStrLn . show) res

proc :: Stack -> Result
proc = reverse . snd . foldl proc' ([], [])
  where proc' (s, res) 0 = let (i, s') = pop s in (s', i : res)
        proc' (s, res) i = (push s i, res)

push :: Stack -> Int -> Stack
push xs i = i : xs

pop :: Stack -> (Int, Stack)
pop (x:xs) = (x, xs)

Measured memory_bytes: 3860
#include<iostream>
#include <string>
using namespace std;
int main(){
  string p;
  int i,j;
  cin >> p;
  for (size_t i = 0; i < p.length(); i++) {
    /* code */
    for (size_t j = 0; j < p.length(); j++) {
      /* code */
      if(i!=j){
      if(p[i]==p[j]){
        cout<<"no\n";
        return 0;
      }
    }
    }
  }

  cout<<"yes\n";
  return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import re
import string

N, K = map(int, input().split())
As = list(sorted(set(map(int, input().split()))))

def gcd(a, b):
    while b:
    	a, b = b, a % b
    return a

# corner
if len(As) == 1:
    if K == As[0]:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
else:        
    for i in range(len(As)-1):
        diff = As[i+1] - As[i]
        if i == 0:
            unit = diff
        else:
            unit = gcd(unit, diff)
    
    ok = False
    for a in As:
        if (a - K) % unit == 0 and K <= a:
            ok = True
    
    if ok:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")


Measured memory_bytes: 21992
h,w = list(map(int,input().split()))
 
if h % 2 == 0:
  ans = h / 2 * w
elif h == 1 or w == 1:
  ans = 1
else:
  ans = ((h + 1) / 2 * w) - (int(w / 2) * 1)
print(int(ans))

Measured memory_bytes: 3060
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;
int main()
{
    int a,b,x;
    while(scanf("%d%d%d",&a,&b,&x)==3)
    {
        if(x>=a&&x<=a+b)
            printf("YES\n");
        else
            printf("NO\n");
    }
    return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;
class Main{
    public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in)){
            String line = sc.nextLine();
            StringBuilder answer = new StringBuilder("");
            int length = line.length();
            for(int i =0; i<length; i++){
                char ch = line.charAt(i);
                if(Character.isLowerCase(ch)){
                    answer.append(Character.toUpperCase(ch));
                }else{
                    answer.append(Character.toLowerCase(ch));
                }
            }
            System.out.println(answer);
        }
    }
}


Measured memory_bytes: 26144
N = int(input())
money = []
oko = 0
for i in range(N):
  money.append(input().split(" "))
  if money[i][1] == "JPY":
    oko += float(money[i][0])
  elif money[i][1] == "BTC":
    oko += (float(money[i][0]) * 380000.0)
  
print(oko)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
/**
******************* Author:Bisnu sarkar ****************************
**/
/*
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
*/
#define fRead(x)       freopen(x,"r",stdin)
#define fWrite(x)      freopen (x,"w",stdout)
#define ull            unsigned long long
#define ll             long long
#define pii            pair<int,int>
#define sit            set<int> :: iterator
#define vrit           vector<int> :: reverse iterator
#define ff             first
#define ss             second
#define endl           '\n';
#define sz(s)          (int)s.size()
#define all(s)         s.begin(),s.end()
#define IO             ios_base::sync_with_stdio(false),cin.tie(NULL);  
#define what_is(x)     cerr << #x << " is " << x << endl;
///*....Debugger....*///
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {cout << endl;}
template<typename T, typename... Args> void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << ", ";
  err(++it, args...);
}
///*....Input....*///
template <typename T> inline void Int(T &n) {
  n = 0; int f = 1; register int ch = getchar();
  for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
  n = n * f;
}
 
template <typename T, typename TT> inline void Int(T &n, TT &m) { Int(n); Int(m); }
template <typename T, typename TT, typename TTT> inline void Int(T &n, TT &m, TTT &l) { Int(n, m); Int(l);}
double ind(){double x; scanf("%lf",&x);return x;}

///*....Bitmask....*///
int set_1(int n,int pos){return n = (n | (1<<pos));}
int reset_0(int n,int pos){return n= n & ~(1<<pos);}
bool check_bit(int n,int pos){return n = n & (1<<pos);}

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

///*....Constraints....*///
const int N = (int) 1e6 + 5;
const int M = (int) 1e9 + 7;
const double pi=2* acos(0.0);
const double eps=1e-9;

int a[15][15],c[15];
int main()
{
    int n,m,x;
    Int(n,m,x);

    for(int i=0;i<n;++i){
        Int(c[i]);
        for(int j=0;j<m;++j){
            Int(a[i][j]);
        }
    }
    ll res=-1;
    for(int i=1;i<(1<<n);++i){
        std::vector<int> v(n+2,0);
        ll sum=0ll;
        for(int j=0;j<n;++j){
            if(check_bit(i,j)){
                sum+=c[j];
                for(int k=0;k<m;++k){
                    v[k]+=a[j][k];
                }
            }
        }
        bool f=true;
        for(int j=0;j<m;++j){
            if(v[j] < x){
                f=false;
                break;
            }
        }
        if(f){
            if(res==-1)res=sum;
            else res=min(res,sum);
        }
    }
    printf("%lld\n", res);


    return 0;
}



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

#define fo(i,s,t) for(int i = s; i <= t; ++ i)
#define fd(i,s,t) for(int i = s; i >= t; -- i)
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define sf scanf
#define pb push_back
#define pf printf
typedef long long ll;
typedef double db;
const int maxn = 100050;
const int inf = 1<<30;
const ll INF = 1ll<<60;
const db eps = 1e-9;

map<int,int> Cnt;
int N;
vector<int> Backup;
ll ans;

int main()
{
	sf("%d",&N);
	fo(i,1,N)
	{
		int x; sf("%d",&x);
		Cnt[x] ++;
		if(Cnt[x] == 2) Backup.pb(x); 
		if(Cnt[x] == 4) ans = max(ans, (ll)x*x);
	}
	sort(Backup.begin(),Backup.end());
	if(Backup.size() < 2) return 0*pf("%lld\n",ans);
	for(int i = 0; i < Backup.size()-1; ++ i)
		ans = max(ans, (ll)Backup[i]*Backup[i+1]);
	printf("%lld\n",ans);
	return 0;
}

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

#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define int long long
#define all(v) v.begin() , v.end()
#define pb push_back
#define pii pair<int,int>
#define fr(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
#define nl '\n'
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

vector<string>arr(6);
int n , m , k;

void subsetsUtil(vector<pii>& A, vector<vector<pii> >& res,
                 vector<pii>& subset, int index)
{
    res.push_back(subset);
    for (int i = index; i < A.size(); i++) {

        // include the A[i] in subset.
        subset.push_back(A[i]);

        // move onto the next element.
        subsetsUtil(A, res, subset, i + 1);

        // exclude the A[i] from subset and triggers
        // backtracking.
        subset.pop_back();
    }

    return;
}

vector<vector<pii> > subsets(vector<pii>& A)
{
    vector<pii> subset;
    vector<vector<pii> > res;

    // keeps track of current element in vector A;
    int index = 0;
    subsetsUtil(A, res, subset, index);

    return res;
}

int32_t main()
{   fastio;


    cin>>n>>m>>k;
    for(int i=0; i<n; i++)
    {
        cin>>arr[i];
    }

    vector<pii>v;
    for(int i=0; i<n; i++)
    {
        v.pb({i , 0});
    }
    for(int i=0; i<m; i++)
    {
        v.pb({i , 1});
    }

    vector<vector<pii> > res = subsets(v);

    // for(auto x:res)
    // {
    //     for(auto y:x)
    //         cout<<y.F<<" "<<y.S<<"\n";
    //     cout<<"\n";
    // }


    //cout<<res.size()<<"\n";
    int cnt=0;
    for(int i=0; i<res.size(); i++)
    {
        vector<string> temp=arr;
        for(int j=0; j<res[i].size(); j++)
        {
            if(res[i][j].S == 1)
            {
                int l=res[i][j].F;
                for(int p=0; p<n; p++)
                {
                    temp[p][l]='.';
                }
            }
            else
            {
                int l=res[i][j].F;
                for(int p=0; p<m; p++)
                {
                    temp[l][p]='.';
                }
            }
        }
        //for(auto x:temp)cout<<x<<"\n";
        int tnt=0;
        for(int j=0; j<n; j++)
        {
            for(int p=0; p<m; p++)
            {
                if(temp[j][p] == '#') tnt++;
            }
        }
        if(tnt == k) cnt++;
    }
    cout<<cnt<<"\n";

}


Measured memory_bytes: 4184
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())


def ex_square(n,k): #n^k
	if k <= 0:
		return 1
	elif k % 2 == 0:
		ans = ex_square(n, k//2) ** 2
	else:
		ans = ex_square(n,k-1) * n
	return ans%mod

S = list(input())

aa = [0]
bb = [0]
cc = [0]
qq = [0]
Sa = Sb =Sc = Sq = 0
for s in S:
	if s == 'A':
		Sa += 1
	elif s == 'B':
		Sb += 1
	elif s == 'C':
		Sc += 1
	elif s == '?':
		Sq += 1
	aa.append(Sa)
	bb.append(Sb)
	cc.append(Sc)
	qq.append(Sq)

ans = 0
ex = [ex_square(3,Sq),ex_square(3,Sq-1),ex_square(3,Sq-2),ex_square(3,Sq-3)]

for i,s in enumerate(S):
	if s == 'B':
		k = 0
	elif s == '?':
		k = 1
	elif s == 'A' or s == 'C':
		continue

	Lq = qq[i]
	Rq = Sq-Lq-k
	La = aa[i]
	Rc = Sc - cc[i]

	ans1 = (ex[0 + k] * (La*Rc)%mod)%mod
	ans2 = (ex[1 + k] * (Lq*Rc)%mod)%mod
	ans3 = (ex[1 + k] * (La*Rq)%mod)%mod
	ans4 = (ex[2 + k] * (Lq*Rq)%mod)%mod
	ans += (ans1+ans2+ans3+ans4)%mod
	ans %= mod

print(ans)


Measured memory_bytes: 11440
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
#define fore(i,x,y) for(long long i=x;i<y;i++)
typedef long long ll;
using namespace std;
int main()
{
	ll N,ANS=0,flug=0;
	vector<ll>vec;
	cin >> N;
	fore(i,0,N){
		ll t;
		cin >> t;
		vec.push_back(t);
	}
	for(int i=0;;i++){
		for(int j=0;j<N;j++){
			//cout << vec[j] << endl;
			if(vec[j]%2==0&&vec[j]/2!=0){
				vec[j]=vec[j]/2;
			}
			else{
				flug=1;
			}
		}
		if(flug==1){
			break;
		}
		else{
			ANS++;
		}
	}
	cout << ANS << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl; 
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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; }

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

    ll n,l;
    cin>>n>>l;
    vector<ll> a(n);
    rep(i,n){
        cin>>a[i];
    }
    bool f=false;
    ll L,R;
    for(int i=0;i<n-1;i++){
        if(a[i]+a[i+1]>=l){
            f=true;
            L=i,R=i+1;
        }
    }
    if(!f){
        cout<<"Impossible"<<endl;
        return 0;
    }

    vector<ll> ans;
    for(int i=R;i<n;i++) ans.push_back(i);
    for(int i=L;i>0;i--) ans.push_back(i);


    reverse(ALL(ans));
    cout<<"Possible"<<endl;
    rep(i,ans.size()){
        cout<<ans[i]<<endl;
    }
    return 0;
}


Measured memory_bytes: 2548
#include <bits/stdc++.h>
const int INF=1e9;
const int MOD=1e9+7;
//const int MOD=998244353;
const long long LINF=1e18;
using namespace std;
#define int long long
//template

//main
signed main(){
  int N;cin>>N;
  std::vector<int> v(N);
  for(int i=0;i<N;i++)cin>>v[i];
  int ans=LINF;
  for(int i=0;i<N;i++){
    int res=0;
    for(int j=0;j<N;j++){
      if(j<=i)res+=v[j];
      else res-=v[j];
    }
    ans=min(ans,abs(res));
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cassert>
#include<cstring>
#include<climits>
#include<sstream>
#include<deque>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<bitset>

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)

using namespace std;

typedef long long ll;

int main() {
  int n;
  string s;
  cin >> n >> s;
  int x = 0,maxi = 0;
  rep(i,n) {
    if( s[i] == 'I' ) ++x;
    else --x;
    maxi = max(maxi,x);
  }
  cout << maxi << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
	int n,i,nr;
	cin >> n;
	
	nr = (n%10)*100 + ((n/10)%10) *10 + n/100;
	if (n == nr){
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
	int m , r, f,g,h;
	while(1){
		scanf("%d %d %d",&m,&f,&r);
		g = m + r + f;
		if(g == -3) break;
		h = m + f;
		if(m == -1 || f == -1) puts("F");
		else if( h >= 80) puts("A");
		else if(h >= 65) puts("B");
		else if(h >= 50) puts("C");
		else if(h >= 30){
			if(r >= 50) puts("C");
			else puts("D");
		}
		else puts("F");
	}
	return 0;
}

Measured memory_bytes: 584
#pragma GCC optimize("O3")

#include <iostream>
#include <algorithm>
#include <vector>
#include <cassert>
#include <cstring>
#include <numeric>
#include <set>
#include <queue>
#include <deque>
#include <array>
#include <string>
#include <cmath>
#include <random>
#include <ctime>
#include <map>
#include <functional>
#include <bitset>
#include <complex>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>

#define sz(a) (int)((a).size())
#define all(a) (a).begin(), (a).end()
#define pb push_back

using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using ld = long double;

int32_t main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	
	ll n, a, b;
	cin >> n >> a >> b;

	if ((b - a) % 2 == 0) {
		cout << (b - a) / 2;
		return 0;
	}

	ll ans1;
	{
		ll aa = 0;
		ll bb = b - a;
		ans1 = a + (bb - aa) / 2;
	}

	ll ans2;
	{
		ll aa = a + (n - b + 1);
		ll bb = n;
		ans2 = (n - b + 1) + (bb - aa) / 2;
	}

	cout << min(ans1, ans2);
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int dp[105][305];
int n,W;
int w[1000005],v[1000005];
int d,ans=0;
int main()
{
	int i,j,k;
	scanf("%d%d",&n,&W);
	for(i=1;i<=n;i++)scanf("%d%d",&w[i],&v[i]);
	for(i=0;i<=n;i++)for(j=0;j<=300;j++)dp[i][j]=0;
	for(i=1;i<=n;i++)
		for(j=n;j>0;j--)
			for(k=300;k>=0;k--)
			{
				d=w[i]-w[1];
				if(k<d)break;
				dp[j][k]=max(dp[j][k],dp[j-1][k-d]+v[i]);
			}
	for(i=0;i<=n;i++)for(j=0;j<=300;j++)
		if(1ll*i*w[1]+1ll*j<=1ll*W)ans=max(ans,dp[i][j]);
	printf("%d\n",ans);
	return 0;
}


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

int main(){
	int a,b;
	int f = 1;
	scanf("%d %d",&a,&b);
	if(1.0*(a+b)/2-(int)(a+b)/2<1e-6) printf("%d\n",(a+b)/2);
	else printf("IMPOSSIBLE\n");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int mod = 1e9+7;
int x[100005], y[100005];
int main(){
    int n, m;
    scanf("%d%d", &n, &m);
    for(int i=1;i<=n;i++) scanf("%d", &x[i]);
    for(int i=1;i<=m;i++) scanf("%d", &y[i]);
    LL sumx = 0, sumy = 0, tmp = 0;
    for(int i=2;i<=n;i++){
        int L = abs(x[i]-x[i-1]);
        sumx = (sumx + L*1ll*(i-1) + tmp)%mod;
        tmp = L*1ll*(i-1) + tmp;
    }
    tmp = 0;
    for(int i=2;i<=m;i++){
        int L = abs(y[i]-y[i-1]);
        sumy = (sumy + L*1ll*(i-1) + tmp)%mod;
        tmp = L*1ll*(i-1) + tmp;
    }
    printf("%lld\n", sumx*sumy%mod);
}

Measured memory_bytes: 1024
#include<iostream>
#include<fstream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<math.h>
#include<algorithm>
#include<iomanip>
#include<set>
#include<utility>

using namespace std;

double f(double r1, double r2) {
  if(r2 > r1) swap(r1, r2);
  return sqrt(pow(r1 + r2, 2) - pow(r2 - r1, 2));
}

int main() {
  int n;
  cin >> n;
  vector<double> d(n);
  for(int i = 0; i < n; i++) cin >> d[i];
  vector<double> e(n);
  e[0] = d[0];
  for(int i = 1; i < n; i++) {
    double m = d[i];
    for(int j = 0; j < i; j++) {
      m = max(m, e[j] + f(d[i], d[j]));
    }
    e[i] = m;
  }
  double ans = 0;
  for(int i = 0; i < n; i++) ans = max(ans, d[i] + e[i]);
  printf("%.9f\n", ans);
  return 0;
}

Measured memory_bytes: 3216
#include <bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef DEBBY
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define ll long long
#define rep(i,a,b) for(int i=int(a); i<=int(b); i++)
#define sz(v)  (int)(v).size()
#define all(v) (v).begin(), (v).end()
#define pi pair<int,int>
#define vi vector<int>
#define vpi vector<pi>
#define fs first
#define sd second
#define pb push_back


void solve(){
    int n; cin >> n;
    vi v(n);
    rep(i,0,n-1)
      cin >> v[i];
    int count=0;
    for(int i=1; i<n-1; i++){
      if((v[i]>v[i-1] && v[i]<v[i+1]) || (v[i]<v[i-1]&&v[i]>v[i+1]))
          count++;
    }
    cout << count;
} 

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    return 0;
}
    





Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int a,b,c;
  int i,divisor=0;
  
  scanf("%d%d%d", &a, &b, &c);
  
  for(i=a;i<=b;i++){
    if(c % i == 0)
      divisor++;
  }
  printf("%d\n",divisor);
  
  return 0;
}

Measured memory_bytes: 596
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ignore ignore
#define pb emplace_back
#define mt make_tuple
#define gcd __gcd
#define bitcount(x)  __builtin_popcount(x)
#define bitcountll(x)  __builtin_popcountll(x)
// Input
#define in(a) scanf("%d",&a)
#define in2(a,b) scanf("%d%d",&a,&b)
#define in3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define llin(a) cin >> a
#define inl(a) scanf("%lld",&a)
#define read(v,i,n) for(i=0;i<n;i++)in(v[i])
#define twod(mat,i,j,n,m) rep(i,n){rep(j,m)in(mat[i][j]);}
#define sc(ch) scanf("%c",&ch)
#define sstr(str) scanf("%s",str)
// Output
#define pr(a) printf("%d ",a)
#define pr2(a,b) printf("%d %d\n",a,b)
#define pr3(a,b,c) printf("%d %d %d\n",a,b,c)
#define out(a) printf("%d\n",a)
#define outl(a) printf("%lld\n",a)
#define llpr(a) cout << a << " "
#define llout(a) cout << a << "\n"
#define YES printf("YES\n")
#define NO printf("NO\n")
#define yes printf("Yes\n")
#define no printf("No\n")
#define lin printf("\n")
// Iterator
#define rep(i,n) for(i=0;i<n;++i)
#define rrep(i,n) for(i=n-1;i>=0;--i)
#define lp(i,a,b) for(i=a;i<b;++i)
#define rlp(i,a,b) for(i=a;i>=b;--i)
#define all(vec) vec.begin(),vec.end()
#define lower(v,k) lower_bound(v.begin(),v.end(),k)-v.begin()
#define upper(v,k) upper_bound(v.begin(),v.end(),k)-v.begin()
#define tf(mytuple) get<0>(mytuple)
#define ts(mytuple) get<1>(mytuple)
#define tt(mytuple) get<2>(mytuple)
// function
#define sz(x) x.size()
#define inrange(i,a,b) (i>=a && i<=b)
#define FLUSH fflush(stdout)
#define precision(x) cout << setprecision(x) << fixed
#define remax(a,b) a=max(a,b)
#define remin(a,b) a=min(a,b)
// Debug
#define dbg(v,i,n) for(i=0;i<n;i++)pr(v[i]); lin
#define what(x) cerr << #x << " : " << x << "\n"
#define ck printf("continue\n")
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
	cerr << *it << " = " << a << "\n";
	err(++it, args...);
}
// Data Type
#define ll long long int
#define ii pair<int,int>
#define pli pair<ll,int>
#define triple tuple<int,int,int>
#define vi vector<int>
#define vii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define viii vector<pair<pair<int,int>,int> >
#define vvii vector<vector<pair<int,int> > >
// Constant
const double PI = acos(-1);
const double eps = (1e-9);
const ll INF = 2e9;
const int M = (1e9)+7;
const int N = (1e6)+3;  // check the limit, man
int main()
{
    int i,n,f;
    string str;
    llin(str);
    n=sz(str);
    f=1;
    rep(i,n)
    {
        if(i&1 && str[i]=='R')
            f=0;
        if(i%2==0 && str[i]=='L')
            f=0;
    }
    if(f)
        yes;
    else
        no;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N ; cin >>N ; //カードの枚数
  int N2=N ; //残り枚数
  vector<int> cards(N);
  for(int i;i<N;i++) cin>>cards[i]; //カードの点を配列化
  int A=0,B=0;
  while(N2>0)
  {
  //アリスのターン
    int a=0,b=0;
    for(int i=0;i<N;i++)
    {
    if(cards[i]>a){a=cards[i];b=i;}
    
    }
    A+=a;cards[b]=0;
    N2--;
    if(N2==0)break;
  //ボブのターン
      a=0,b=0;
    for(int i=0;i<N;i++)
    {
    if(cards[i]>a){a=cards[i];b=i;}
    
    }
    B+=a;cards[b]=0;
    N2--;
  }

  cout <<A-B <<endl;

}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  char s[5];
  scanf("%s",&s);

  if(s[0]==s[1]){
    if(s[2]==s[3]){
      if(s[0]!=s[2]){
        printf("Yes\n");
      }else{
        printf("No\n");
      }
    }else{
      printf("No\n");
    }
  }else if(s[0]==s[2]){
    if(s[1]==s[3]){
      printf("Yes\n");
    }else{
      printf("No\n");
    }
  }else if(s[0]==s[3]){
    if(s[1]==s[2]){
      printf("Yes\n");
    }else{
      printf("No\n");
    }
  }else{
    printf("No\n");
  }

	return 0;
}


Measured memory_bytes: 128
S=input()
y,m=int(S[:2]),int(S[2:])

def im(m):
    return 1 <= m and m <= 12

ay = im(y)
am = im(m)
if ay and am :
    print('AMBIGUOUS')
elif ay:
    print('MMYY')
elif am:
    print('YYMM')
else:
    print("NA")



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

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
#define PI 3.14159265359 //πの値
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

 
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
  ll A, B;
  cin >> A >> B;
  cout << A*B;
}

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

using namespace std;


int main(){
    
    int n,l,r;
    while(cin >> n >> l >> r){
        if(n == 0 && l == 0 && r == 0)
            return 0;
        vector<int> vec;
        for(int i = 0;i < n;i++){
            int b;cin >> b;
            vec.push_back(b);
        }
        int ans = 0;
        for(int i = l;i <= r;i++){
            bool f = true;
            bool e = false;
            for(int j = 0;j < n;j++){
                if(i % vec.at(j) == 0){
                    f = false;
                    if((j + 1) % 2){
                        e = true;
                    }
                    break;
                }
            }
            
            if(f && n%2 == 0){
                e = true;
            }
            
            if(e){
                ans++;
               // cout << i << endl;
            }
        }
       
        //cout<<endl;
        cout<<ans<<endl;
    }
    
    return 0;
}


Measured memory_bytes: 3096
import java.util.Scanner;

/**
 *
 * @author Ivan Eka
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char N = sc.next().charAt(0);
        if(N == '1'){
            System.out.println("Hello World");
        } else if(N == '2'){
            int A = sc.nextInt();
            int B = sc.nextInt();
            System.out.println(A + B);
        }
    }
}

Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,k,c;
  cin >> a >> b >> k;
  c=0;
     for(int i=max(a,b);i>0;i--){
       if(a%i==0&&b%i==0){
         c++;
         if(c==k)
        cout<<i<<endl;
       }
     }
}

Measured memory_bytes: 256
/*
@author: sharrad99
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld double
#define mp make_pair
#define ff first
#define ss second
#define mll map<ll,ll>
#define pll pair<ll,ll>
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mod 1000000007
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll n;
	cin>>n;
	vector<ll> d(n);
	for(ll i=0;i<n;i++){
		cin>>d[i];
	}
	ll s=0;
	for(ll i=0;i<n;i++){
		for(ll j=i+1;j<n;j++){
			s+=(d[i]*d[j]);
		}
	}
	cout<<s;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define int ll
#define pb push_back
#define setbits(x)          __builtin_popcountll(x)
#define endl "\n"
typedef long long ll;
const int mx=10000001;
int dp[mx];
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
dp[1]=1;
for(int i=2;i<mx;i++)
{if(!dp[i])
    {
    for(int j=i;j<mx;j+=i)
    dp[j]=i;
    }
}
int n;
cin>>n;
int ans=0;
  for(int i=0;i<100;i++);
for(int i=1;i<=n;i++)
{  map<int,int> mp;
  int x=i;
  while(x!=dp[x])
  {
      mp[dp[x]]+=1;
      x/=dp[x];
  }
  if(x!=1)
  mp[dp[x]]+=1;
    int res=1;
    map<int,int>::iterator it=mp.begin();
    for(;it!=mp.end();it++)
    {
         x=(it->second);
         x+=1;
        res*=x;
    }
    ////cout<<i<<" "<<res<<endl;
    ans+=i*res;
}

cout<<ans<<endl;











    return 0;
}

Measured memory_bytes: 81760
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>

using namespace std;

int main(){
     char a[3],b[3];
     scanf("%s",a);
     scanf("%s",b);
     if(a[0]==b[2]&&a[1]==b[1]&&a[2]==b[0])
     	{
     		printf("YES\n");
		}
	else 
		printf("NO\n");
}


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	A := make([]int, N)
	m := make(map[int]int)
	for i := range A {
		fmt.Scan(&A[i])
		m[A[i]]++
	}
	total := 0
	for _, c := range m {
		total += c * (c - 1) / 2
	}
	for i := 0; i < N; i++ {
		fmt.Println(total - (m[A[i]] - 1))
	}
}


Measured memory_bytes: 16888
import java.util.*;
import java.math.*;

public class Main {
    public static void main(String[] args) {
        Scanner itr = new Scanner(System.in);
        int N = itr.nextInt();
        int[] stone = new int[N];

        for (int i = 0; i < N; i++) {
            stone[i] = itr.nextInt();
        }

        int[] dp = new int[N];
        Arrays.fill(dp, Integer.MAX_VALUE);
        dp[0] = 0;
        dp[1] = Math.abs(stone[0] - stone[1]);

        for (int i = 2; i < N; i++) {
            dp[i] = Math.min(dp[i - 1] + Math.abs(stone[i - 1] - stone[i]), dp[i - 2] + Math.abs(stone[i - 2] - stone[i]));
        }

        System.out.println(dp[N - 1]);
    }
}

Measured memory_bytes: 48412