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

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(), (a).end()

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;

void sayYes() {puts("Yes");}
void sayNo() {puts("No");}
template<class T> bool chmin(T&a,T b) {if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b) {if(a<b){a=b;return true;}return false;}

class FastIO {
public:
    FastIO() {
        cin.tie(0);
        ios::sync_with_stdio(false);
    }
    ~FastIO() {}

    template <class T>
    void scan(T &v) {
        cin >> v;
    }
    template <class T, class... Rest>
    void scan(T &v, Rest&... rest) {
        scan(v);
        scan(rest...);
    }

    template <class T>
    void print(T v) {
        cout << v;
    }
    template <class T, class... Rest>
    void print(T v, Rest... rest) {
        print(v);
        print(" ");
        print(rest...);
    }
    template <class T>
    void prints(vector<T> v) {
        for (T t: v) {
            print(t);
            print(" ");
        }
        print("\n");
    }
    template <class T>
    void prints(T v) {
        print(v);
        cout << "\n";
    }
    template <class T, class... Rest>
    void prints(T v, Rest... rest) {
        print(v);
        print(" ");
        prints(rest...);
    }
};
FastIO io;


int main() {
    string s; io.scan(s);
    if (s == "Sunny") io.print("Cloudy");
    if (s == "Cloudy") io.print("Rainy");
    if (s == "Rainy") io.print("Sunny");
}

Measured memory_bytes: 256
n = int(input())
s = 0
while n - 5 > 0:
  if n - 500 >= 0:
    n -= 500
    s += 1000
  elif n - 100 >= 0:
    n -= 100
    s += 100
  elif n - 50 >= 0:
    n -= 50
    s += 50
  elif n - 10 >= 0:
    n -= 10
    s += 10
  elif n - 5 > 0:
    n -= 5
    s += 5
  #elif n - 1 >= 0:
   # n -= 1
   # s += 1
print(s)



Measured memory_bytes: 3060
import java.util.*;
import java.lang.*;

class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int d[] = new int[N];
        int recover = 0;

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

        for(int i = 0; i < N-1 ; i++){
          int a = d[i];
          for(int j = i+1; j < N; j++){
            recover += a * d[j];
          }
        }

        System.out.println(recover);



    }
}






Measured memory_bytes: 21844
#include<stdio.h>
#define MAX 100005
#define NIL -1
struct Node_struct{int p, l, r;}; /*p: 親(parent), l: 一番左の子(left child), r:右の兄弟(right sibling)*/
typedef struct Node_struct Node;
Node T[MAX];
int D[MAX];

void print(int u){
  int i, c;
  printf("node %d: parent = %d, depth = %d, ", u, T[u].p, D[u]);

  if(T[u].p==NIL) printf("root, ");
  else if(T[u].l==NIL) printf("leaf, ");
  else printf("internal node, ");
  
  printf("[");
  for (i=0, c = T[u].l; c != NIL; i++, c = T[c].r){
    if(i) printf(", ");
    printf("%d", c);
  }
  printf("]\n");
  
}

void calcDepth(int u, int p){
  D[u] = p;
  if(T[u].l!=NIL) calcDepth(T[u].l,p+1);
  if(T[u].r!=NIL) calcDepth(T[u].r,p);
}

int main(){
  int i, j, k;
  int n;
  int id, sib, child;
  int root = NIL;
  scanf("%d", &n);
  for(i=0; i<n; i++) T[i].p = T[i].l = T[i].r = NIL;
  
  for(i=0; i<n; i++){
    scanf("%d %d", &id, &k);
    for(j = 0, sib = NIL; j<k; j++){ //子を入力する (input children)
      scanf("%d", &child);
      T[child].p = id;
      if(j == 0) T[id].l = child; //idの一番左の子 (the most left child of id)
      else T[sib].r = child; //左の兄弟に繋げる (connect to left sibling)
      sib = child;//次の子供の左の兄弟 (the left sibling of the next child)
    }
  }

  //根を求める (find the root)
  for(i=0; i<n; i++){
    if(T[i].p == -1) root = i;
  }
  
  //それぞれのノードの深さを求める (find depth of each node)
  calcDepth(root, 0);

  //出力 (output)
  for(i=0; i<n; i++) print(i);
  
  return 0;
}



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

using namespace std;

int main(){
  long int n, k, sum = 0;
  cin >> n >> k;
  vector<int> h(n);
  for(int i=0;i<n;++i){
    cin >> h[i];
  }
  sort(h.begin(), h.end());
  if(k>=n){
    cout << 0 << endl;
    return 0;
  }else{
    int use = n-k;
    for(int i=0;i<n-k;++i){
      sum += h[i];
    }
    cout << sum << endl;
  }
  return 0;
}

Measured memory_bytes: 1024
MOD = 10**9+7
n, m = map(int, input().split())
a = ['' for _ in range(n)]
for i in range(n):
    a[i] = input()
dp = [[0] * m for _ in range(n)]
dp[0][0] = 1
for i in range(n):
    for j in range(m):
        if a[i][j] == '.':
            if i - 1 >= 0:
                dp[i][j] = (dp[i][j] + dp[i - 1][j]) % MOD
            if j - 1 >= 0:
                dp[i][j] = (dp[i][j] + dp[i][j - 1]) % MOD
print(dp[-1][-1])

Measured memory_bytes: 51952
while True:
    W = input().rstrip()
    if W == "-":
        break
    m = int(input().rstrip())
    l = list(W)
    for i in range(m):
        h = int(input().rstrip())
        w = l[:h]
        del l[:h]
        l += w
    ans = "".join([str(i) for i in l])
    print(ans)


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

using namespace std;
using Int = long long;

const int mod = 1000000007;
const int nax = 100010;

int n;
int ar[101];
int dp[nax][101];

void add(int &a, int b) {
  a += b;
  if(a >= mod) {
    a -= mod;
  }
}

int sub(int a, int b) {
//  sub(a, b);
  a -= b;
  if(a <= mod) a += mod;
  return a;
}

int rec(int idx, int k) {
  if(k == 0) {
    return 1;
  }
  if(k < 0 || idx >= n) {
    return 0;
  }
  int &x = dp[k][idx];
  if(x != -1) {
    return x;
  }
  x = 0;

// adding interval [k.....k - ar[idx]]
//  for(int i = 0; i <= ar[idx]; ++i) {
//    add(x, rec(idx + 1, k - i));
//  }
  
  add(x, sub(rec(idx + 1, k), rec(idx + 1, k - ar[idx] - 1)));
  add(x, rec(idx, k - 1));

  return x;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  int k;
  cin >> k;
  for(int i = 0; i < n; ++i) {
    cin >> ar[i];
  }
  memset(dp, -1, sizeof dp);
  cout << rec(0, k) << '\n';
  //~ cerr << dp[n - 1][k] << '\n';
  return 0;
}


Measured memory_bytes: 47488
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cassert>
#include <complex>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <sstream>
#include <ctime>
#include <cctype>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <deque>
#include <stack>
#include <memory.h>
using namespace std;
#define ll long long 
int main()
{
    string s;
    cin>>s;
	char st,en;
	st=s[0],en=s[s.size()-1];
	cout<<st<<s.size()-2<<en;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	int *score;
	int s,i;
	while(scanf("%d", &s) != EOF && s != 0){
		int max=0, min=1000, sum=0, average;
		score = (int *)(malloc(sizeof(int) * s));
		for(i = 0; i < s; i++){
			scanf("%d", (score + i));
			sum = sum + score[i];
			if(score[i] < min){
				min = score[i];
			}
			if(score[i] > max){
				max = score[i];
			}
		}
		sum = sum - (min + max);
		average = sum / (s - 2);
		printf("%d\n", average);
	}
	
	return 0;
}

Measured memory_bytes: 600
#include<iostream>
using namespace std;
int n,d,k,a[101],Ans,i;
int main()
{ 
  cin >> n >> d >> k;
  for(i=0;i<n;i++){
    cin >> a[i];
    Ans=Ans+(d-1)/a[i]+1;
  }
printf("%d",Ans+k);
}

Measured memory_bytes: 256
def lcs(x, y)
  m = x.size
  n = y.size
  dp = Array.new(m + 1) { Array.new(n + 1, 0) }

  1.upto(m) do |i|
    1.upto(n) do |j|
      if x[i - 1] == y[j - 1]
        dp[i][j] = dp[i - 1][j - 1] + 1
      else
        dp[i][j] = [dp[i - 1][j], dp[i][j - 1]].max
      end
    end
  end

  dp[m][n]
end

n = gets.to_i
n.times do
  x = gets.chomp.chars
  y = gets.chomp.chars
  puts lcs(x, y)
end


Measured memory_bytes: 52436
#include"bits/stdc++.h"
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;

int main() {
	int n, a;
	cin >> n >> a;
	if (a >= n) {
		cout << "Yes" << endl;
	}
	else if (a < n) {
		if ((n % 500) <= a) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
	return 0;
}


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

using namespace std;

#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define pb emplace_back
#define ll long long

const int INF = 2e9 + 1;
const ll INFLL = 1e18 + 1;
const ll mod = 1e9 + 7;

vector<vector<int>> f(26);

void incr(int x, int d, int i) {
    for (; x < (int)f[i].size(); x = (x | (x + 1))) f[i][x] += d;
}

int get(int x, int i) {
    int ans = 0;
    for (; x >= 0; x = (x & (x + 1)) - 1) ans += f[i][x];
    return ans;
}

int sum(int l, int r, int i) {
    return get(r, i) - get(l - 1, i);
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    for (int i = 0; i < 26; i++) f[i].resize(n);
    string s;
    cin >> s;
    for (int i = 0; i < n; i++) {
        incr(i, 1, s[i] - 'a');
    }
    int q;
    cin >> q;
    while (q--) {
        int type;
        cin >> type;
        if (type == 1) {
            int i;
            char c;
            cin >> i >> c;
            i--;
            incr(i, -1, s[i] - 'a');
            incr(i, 1, c - 'a');
            s[i] = c;
        } else {
            int l, r;
            cin >> l >> r;
            l--; r--;
            int ans = 0;
            for (int i = 0; i < 26; i++) {
                if (sum(l, r, i) > 0) ans++;
            }
            cout << ans << "\n";
        }
    }
    return 0;
}


Measured memory_bytes: 54720
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 100000000;
#define rep1(i, n) for (ll i=0; i<(n); i++) 
#define rep2(i, k, n) for (ll i=k; i<(n); i++)
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; }

vector<ll> divisor(ll n) {
  vector<ll> ret;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}


int main() {
    ll n;
    cin >> n;
    vector<ll> res=divisor(n), num(2, 1);
    ll l = sqrt(n);
    ll n_min = 0;
    for (auto x: res){
        if (x <= l) n_min = max(n_min, x);
    }
    num[0] = n_min;
    num[1] = n / n_min;
    ll count = 0;
    while (num[1]>0){
        num[1] /= 10;
        count++;
    }
    cout << count << endl;
    //printf("%.12f", ans);
}

Measured memory_bytes: 3708
fn main() {
    let mut buf = String::new();

    std::io::stdin().read_line(&mut buf).unwrap();

    let mut iter = buf.trim().split_whitespace();

    let a: i32 = iter.next().unwrap().parse().unwrap();
    let b: i32 = iter.next().unwrap().parse().unwrap();
    let c: i32 = iter.next().unwrap().parse().unwrap();

    let message = if a < b && b < c {
        "Yes"
    } else {
        "No"
    };

    println!("{}", message);
}


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

using namespace std;

const int oo = 1e9 + 7;
const int maxn = 1e5 + 5;

#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define mp make_pair
#define fi first
#define se second

int n, l[maxn], r[maxn];
set<pair<int, int> > st[4];

int main() {
  cin >> n;

  rep(i, 0, n) {
    cin >> l[i] >> r[i];
    st[0].insert(mp(l[i], i));
    st[1].insert(mp(r[i], i));
  }
  st[2] = st[0];
  st[3] = st[1];

  // 0 - head
  // 1 - tail
  int lv = 0;
  int now = 0;
  long long ans = 0;
  rep(cc, 0, 2) {
//    cout << "here " << cc << endl;
    int lv = cc;
    int now = 0;
    int cnt = 0;
    long long res = 0;
    while (!st[0].empty()) {
      // in all segments when cnt = 2
      if (cnt == 2) break;
      if (!lv) {
        auto it = st[lv].end();
        it--;
        if (it->fi > now) {
          int newPos = it->fi;
          int id = it->se;
          st[0].erase(mp(l[id], id));
          st[1].erase(mp(r[id], id));
          res += abs(newPos - now);
          now = newPos;
          cnt = 0;
        } else cnt++;
      } else {
        auto it = st[lv].begin();
        if (it->fi < now) {
          int newPos = it->fi;
          int id = it->se;
          st[0].erase(mp(l[id], id));
          st[1].erase(mp(r[id], id));
          res += abs(newPos - now);
          now = newPos;
          cnt = 0;
        } else cnt++;
      }
      lv ^= 1;
    }
    res += abs(now);
    ans = max(ans, res);
    st[0] = st[2];
    st[1] = st[3];
  }

  cout << ans;

  return 0;
}


Measured memory_bytes: 19840
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#solve
def solve():
    a = LI()
    a = sum(a)
    print("bust" if a >= 22 else "win")
    return


#main
if __name__ == '__main__':
    solve()


Measured memory_bytes: 39024
parseInt(x::String) = parse(Int, x)
parseInt(x::SubString{String}) = parse(Int, x)
parseInt(x::Char) = parse(Int, x)
parseInt(x::Float64) = trunc(Int, x)
parseFloat(x::String) = parse(Float64, x)
parseFloat(x::Int) = trunc(Float64, x)
parseFloat(x::SubString{String}) = parse(Float64, x)
parseFloat(x::Char) = parse(Float64, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    n=parseInt(readline())
    num=Vector{Int}()
    ans=0
    for i in 1:n
        push!(num,parseInt(readline()))
    end
    sort!(num)
    cnt=1
    for i in 2:n+1
        if i==n+1 || num[i]!=num[i-1]
            if cnt%2==1
                ans+=1
            end
            cnt=1
        else
            cnt+=1
        end
    end
    println(ans)
end
main()

Measured memory_bytes: 181428
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <math.h>
using namespace std;
int main() {
	string s;
	cin >> s;
	int cnt[26] = {};
	bool f = 0;
	for (int i = 0; i < s.size(); i++)cnt[s[i] - 'a']++;
	for (int i = 0; i < 26; i++)if (cnt[i] % 2)f = 1;
	if (f)cout << "No" << endl;
	else cout << "Yes" << endl;
	return 0;
}


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

using namespace std;
using ll = long long;
int main(){
  ll n,x;
  cin >> n >> x;
  vector<ll>a(n);
  for(ll& t:a)cin >> t;
  sort(a.begin(),a.end());
  ll ret=0;
  for(ll& t:a){
    if(t<=x)ret++;
    x-=t;
  }
  if(x>0)ret--;
  cout << ret << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int itti(char *u,char *c){
    int check=0;
    for(int i=0;i<3;i++){
        if(u[i]==c[i]){
            check++;
        }
    }
    if(check==3){
        return 1;
    }else{
        return 0;
    }
}

int main(void){
    int N;
    double x[10],sum=0.0;
    char u[10][3],jpy[3]={"JPY"},btc[3]={"BTC"};
    scanf("%d",&N);
    for(int i=0;i<N;i++){
        scanf("%lf %s",&(x[i]),u[i]);
    }
    for(int i=0;i<N;i++){
        if(itti(u[i],jpy)){
            sum+=x[i];
        }else{
            sum+=(x[i]*380000.0);
        }
    }

    printf("%lf",sum);
    return 0;
}
/*test
1.
2
10000 JPY
0.10000000 BTC
->48000.0
2.
3
100000000 JPY
100.00000000 BTC
0.00000001 BTC
->138000000.0038
*/

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
#define rep1(i,n) for(int i = 1;i<n;i++)
typedef long long ll;
#define vint vector<int>
#define vstring vector<string>
#define vll vector<ll>

int gcm(int a,int b);

int main(){
  ll n;
  cin >> n;
  ll MIN = 1000000000000000;
  rep(i,5){
    ll a;
    cin >> a;
    if(MIN > a) MIN = a;
  }
  if(n%MIN == 0)
    cout << 5 + (n/MIN - 1) << endl;
  else
    cout << 5 + n/MIN << endl;
}

int gcm(int a,int b){
  if(a < b) swap(a,b);
  if(b == 0) return a;
  return gcm(a%b,b);
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000001;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

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

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

class mint {
    long long x;
public:
    mint(long long x = 0) : x((x% MOD + MOD) % MOD) {}
    mint operator-() const {
        return mint(-x);
    }
    mint& operator+=(const mint& a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator-=(const mint& a) {
        if ((x += MOD - a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator*=(const  mint& a) {
        (x *= a.x) %= MOD;
        return *this;
    }
    mint operator+(const mint& a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint& a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint& a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    // for prime MOD
    mint inv() const {
        return pow(MOD - 2);
    }
    mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const {
        mint res(*this);
        return res /= a;
    }

    friend ostream& operator<<(ostream& os, const mint& m) {
        os << m.x;
        return os;
    }
};

///////////////////////////

int main() {
	
    ll x, y;
    cin >> x >> y;

    ll ans;
    if (x * y > 0) {
        if (y >= x) { ans = 0; }
        else { ans = 2; }
    }

    if (x * y < 0) { ans = 1; }

    if (x == 0) {
        if (y >= 0) { ans = 0; }
        else { ans = 1; }
    }

    if (y == 0) {
        if (x <= 0) { ans = 0; }
        else { ans = 1; }
    }

    cout << abs(abs(x) - abs(y)) + ans;

	
	system("PAUSE");
}


Measured memory_bytes: 504
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <bitset>
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define invrepr(i,a,b) for(int i=b-1;i>=a;i--)
#define invrep(i,n) invrepr(i,0,n)

using namespace std;
typedef long long ll;
ll ds(ll Q){
        ll sum=0;
        ll dig;
        while(Q){
        dig = Q % 10;
        sum = sum + dig;
        Q = Q / 10;
        }
        return sum;
    }

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


    ll ans=0;
    ll anss =0;
    ll count=0;
    ll i,j;
  
    long double x;
    vector<ll> aa;

    ll Q,N,K;
    long double a, b;
    string S;
    cin  >>N;
    ll flag=0;
    ll t1=0;
    ll t2=0;
  	
    ll Q1=Q;

    ll temp=1;
    ll pl=1;


    ans=(1+N)*N/2-(1+N/3)*(N/3)/2*3-(1+N/5)*(N/5)/2*5+ (1+N/15)*(N/15)/2*15;
 
    cout<< ans << endl;

    return 0;
}

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

int main() {
  string s;
  cin >> s;
  string judge1 = "true";
  string judge2 = "true";
  for (int i=0; i<s.size() ;i++){
    if (i%2 == 0 && s.at(i) == 'L'){
      judge1 = "false";
    }
    if (i%2 == 1 && s.at(i) == 'R'){
      judge2 = "false";
    }
  }
  if (judge1 == "true" && judge2 == "true"){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <utility>
#include <cmath>

using namespace std;

typedef pair <int, int> ii;

int dirr[2] = {-1, 0}, dirc[2] = {0, -1};

int H, W;
int A[85][85], B[85][85];
bool possible[85][85][10000];

int main()
{
    scanf("%d%d", &H, &W);
    for (int i = 0; i < H; i++) for (int j = 0; j < W; j++) scanf("%d", &A[i][j]);
    for (int i = 0; i < H; i++) for (int j = 0; j < W; j++) scanf("%d", &B[i][j]);
    possible[0][0][(int) abs(A[0][0] - B[0][0])] = true;
    for (int i = 0; i < H; i++) for (int j = 0; j < W; j++)
    {
        for (int k = 0; k < 2; k++)
        {
            ii v = ii(i + dirr[k], j + dirc[k]);
            if (v.first < 0 || v.second < 0) continue;
            for (int l = 0; l < 10000; l++)
            {
                if (possible[v.first][v.second][l])
                {
                    int val1 = abs(l + A[i][j] - B[i][j]);
                    int val2 = abs(l + B[i][j] - A[i][j]);
                    possible[i][j][val1] = true;
                    possible[i][j][val2] = true;
                }
            }
        }
    }
    for (int i = 0; i < 10000; i++)
    {
        if (possible[H - 1][W - 1][i])
        {
            printf("%d\n", i);
            return 0;
        }
    }
}


Measured memory_bytes: 67072
def D_Coloring_Dominoes(N, S1, S2):
    from collections import deque
    S1, S2 = deque(S1), deque(S2)

    def decisionBlock(s1, s2):
        # s1,s2の先頭ドミノが縦に1個か横に2個のブロックになっているかを判定
        if s1[0] == s2[0]:
            block = 'X'  # 解説の"X","Y"の決め方を踏襲
            s1.popleft()
            s2.popleft()
        elif s1[0] == s1[1] and s2[0] == s2[1]:
            block = 'Y'
            s1.popleft()
            s1.popleft()
            s2.popleft()
            s2.popleft()
        else:
            tmp = 'NotBlock'  # 入力の制約上ここに来ないはず
        return block

    combination = 0

    # 最左端のブロックの塗り方の組み合わせを算出しておく
    firstblock = decisionBlock(S1, S2)
    if firstblock == 'X':
        combination += 3
    else:
        combination += 6

    # 残りのブロックの塗り方の組み合わせを求める
    leftblock = firstblock
    while S1 != deque([]):
        block = decisionBlock(S1, S2)
        if (leftblock, block) == ('X', 'X'):
            combination *= 2
        elif (leftblock, block) == ('Y', 'X'):
            combination *= 1
        elif (leftblock, block) == ('X', 'Y'):
            combination *= 2
        elif (leftblock, block) == ('Y', 'Y'):
            combination *= 3
        leftblock = block
    return combination%(10**9+7)

N = int(input())
S1 = input()
S2 = input()
print(D_Coloring_Dominoes(N, S1, S2))

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

# define N 123456

int a [N], b [N], c [N] ;
long long t [N] ;

# undef N

int main ( )  {
	int n ;
	scanf ( "%d", & n ) ;
	for ( int i = 1 ; i <= n ; ++ i )  scanf ( "%d", c + i ) ;
	for ( int i = 1 ; i <= n ; ++ i )  scanf ( "%d", b + i ) ;
	for ( int i = 1 ; i <= n ; ++ i )  scanf ( "%d", a + i ) ;

	std :: sort ( a + 1, a + 1 + n ) ;
	std :: sort ( b + 1, b + 1 + n ) ;
	std :: sort ( c + 1, c + 1 + n ) ;

	for ( int i = 1 ; i <= n ; ++ i )  {
		 t [i] = std :: lower_bound ( c + 1, c + 1 + n, b [i] ) - c - 1 ;
	}

	for ( int i = 1 ; i <= n ; ++ i )  t [i] += t [i - 1] ;

	long long ans ( 0 ) ;

	for ( int i = 1 ; i <= n ; ++ i )  {
		int pos = std :: lower_bound ( b + 1, b + 1 + n, a [i] ) - b - 1 ;
		ans += t [pos] ;
	}

	return printf ( "%lld\n", ans ), 0 ;
}

Measured memory_bytes: 2176
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010


int main(){
  int M, D;

  cin >> M  >> D;

  int ans = 0;

  for(int i=1; i<=M; i++) {
    for(int j=1; j<=D; j++) {
      int d1 = j % 10;
      int d10 = j / 10;

      ans += i == d1 * d10 && d1 >= 2 && d10 >= 2;
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
n,m = gets.split().map(&:to_i)
x = gets.split().map(&:to_i)

x.sort!
p 0 if x.size == 0
d = (0..x.size-2).map {|i| x[i+1] - x[i]}.sort!
d.pop(n-1)
p d == [] ? 0 : d.inject(:+)

Measured memory_bytes: 9968
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(void){
    long N,K;
    long long min = 10e9;
    cin >> N >> K;
    vector<long long> V(N);
    for(long i=0;i<N;i++) cin >> V[i];
    sort(V.begin(),V.end());
    for(long i=K-1;i<N;i++) if (V[i]-V[i-(K-1)] < min) min = V[i]-V[i-(K-1)];
    cout<<min;
    return 0;
}



Measured memory_bytes: 1024
#include<iostream>
#include<string.h>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  while(1){
    int n,m;

    cin>>n>>m;
    if(n==0 &&m==0)break;
    int order[1000]={};
    int i;
    int cnt=1;
    int num=1;
    while(num>0){
      rep(i,n){
	if(order[i])continue;
	if(cnt==m){
	  order[i]=num;
	  cnt=0;
	  if(num==n){
	    num=-1;
	    break;
	  }
	  num++;
	}
	cnt++;
      }
    }
    rep(i,n)
      if(order[i]==n){
	cout<<i+1<<endl;
	break;
      }
  }
}

Measured memory_bytes: 1160
#include <string>
#include <vector>
#include <iostream>
using namespace std;
string s; int x; vector<pair<string, int> > a, b, c;
vector<pair<string, int> > shift(vector<pair<string, int> > v) {
	vector<pair<string, int> > w;
	for (int i = 0; i < v.size(); i++) {
		if (v[i].second > 0) w.push_back(v[i]);
	}
	v = w;
	vector<pair<string, int> > ret;
	int sum = v[0].second;
	for (int i = 1; i <= v.size(); i++) {
		if (i == v.size() || v[i - 1].first != v[i].first) {
			ret.push_back(make_pair(v[i - 1].first, sum));
			sum = 0;
		}
		if (i != v.size()) sum += v[i].second;
	}
	return ret;
}
int main() {
	while (cin >> s, s != "$") cin >> x, a.push_back(make_pair(s, x));
	while (cin >> s, s != "$") cin >> x, b.push_back(make_pair(s, x));
	while (cin >> s, s != "$") cin >> x, c.push_back(make_pair(s, x));
	for (int i = 0; i <= (int)(a.size() - b.size()); i++) {
		bool ok = true;
		for (int j = 0; j < b.size(); j++) {
			if (a[i + j].first != b[j].first) ok = false;
		}
		for (int j = 2; j < b.size(); j++) {
			if (a[i + j - 1].second != b[j - 1].second) ok = false;
		}
		if (a[i].second < b[0].second) ok = false;
		if (a[i + b.size() - 1].second < b[b.size() - 1].second) ok = false;
		if (ok) {
			vector<pair<string, int> > d(a.begin(), a.begin() + i);
			if(b.size() != 1) d.push_back(make_pair(a[i].first, a[i].second - b[0].second));
			d.insert(d.end(), c.begin(), c.end());
			d.push_back(make_pair(a[i + b.size() - 1].first, a[i + b.size() - 1].second - b[b.size() - 1].second));
			d.insert(d.end(), a.begin() + i + b.size(), a.end());
			a = shift(d);
			break;
		}
	}
	for (int i = 0; i < a.size(); i++) cout << a[i].first << ' ' << a[i].second << ' ';
	cout << "$" << endl;
	return 0;
}

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

int main() {
  string str;
  int top = 0;
  cin >> str;
  for(int i=0; i<str.size(); i++) {
    if(str[i] == 'o')
      top+=100;
  }
  cout << 700 + top << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using ll = int_fast64_t;


int main(){
        ll n, a, b;
        scanf("%ld %ld %ld", &n, &a, &b);
        std::vector<ll> h(n);
        for(ll i=0; i<n; i++) scanf("%ld", &h[i]);

        ll l=-1, r=1e9;
        while(r-l>1){
                ll mid = (l+r)/2, cnt = 0;
                for(ll i=0; i<n; i++){
                        cnt += (std::max(0l,h[i]-b*mid) +a-b-1) / (a-b);
                }
                if(cnt>mid) l = mid;
                else r = mid;
        }
        printf("%ld\n", r);
        return 0;
}

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

using namespace std;

#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n)　for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
#define Eunique(v) v.erace(unique(all(v)),v.end())
#define pvec(v)　rep(i,v.size()){cout << v[i] << " ";}
#define INF 0x3f3f3f3f
#define mset(m,v) memset(m,v,sezeof(m))
#define mod 1e9 +7;

const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef deque<ll> dll;
typedef pair<ll,ll> P;
ll dx[4] = {1,0,-1,0},dy[4] = {0,1,0,-1};

ll gcd(ll x,ll y)
{
    ll r;
    while((r = x % y) != 0)
    {
        x = y;
        y = r;
    }
    return y;
}

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

int main()
{
    string  s;
    cin >> s;
    cout << s[0] << SIZE(s)-2 << s[SIZE(s)-1] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>

using namespace std;

typedef long long ll;

ll n;
string s;
ll d[5005][5005];
ll ans;

int main()
{
    cin>>n>>s;
    s = ' ' + s;
    for(ll i = 1; i <= n; i++)
    {
        for(ll j = i + 1; j <= n; j++)
        {
            if(s[i] == s[j] && d[i - 1][j - 1] + 1 <= j - i) d[i][j] = d[i - 1][j - 1] + 1, ans = max(ans, d[i][j]);
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 194944
#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const int INF = 1000000;
const double PI=3.14159265359;
int main(){

  int h,w;cin>>h>>w;
  string s[h];rep(i,0,h)cin>>s[i];

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

  int sy=0,sx=0;
  int d[h+1][w+1];

  queue<P>qq;
  rep(i,0,h){
    rep(j,0,w){
      if(s[i][j]=='.'){
        qq.push(P(j,i));
      }
    }
  }

  // out(qq.size());
  int ans=0;
  while(!qq.empty()){
    // out(qq.size());

    // out(qq.size());
    // cout<<sx<<" "<<sy<<endl;
    P pp=qq.front();
    qq.pop();
    int sx=pp.first,sy=pp.second;
    rep(i,0,h){
    rep(j,0,w){
      d[i][j]=INF;
    }
  }
    // int sy=p
    d[sy][sx]=0;

    queue<P>q;
    q.push(P(sx,sy));

    while(!q.empty()){
      P p=q.front();
      q.pop();
      int x=p.first,y=p.second;

      // if(x==gx&&y==gy)break;

      for(int i=0;i<4;i++){
        int nx=x+dx[i],ny=y+dy[i];

        if(nx>=0&&ny>=0&&nx<=w&&ny<=h&&s[ny][nx]!='#'&&d[ny][nx]==INF){
          q.push(P(nx,ny));
          d[ny][nx]=d[y][x]+1;
        }
      }
    }


    rep(i,0,h){
      rep(j,0,w){
        if(d[i][j]==INF)continue;
        ans=max(ans,d[i][j]);
      }
    }
  }

  out(ans);

  // rep(i,0,h){
  //   rep(j,0,w){
  //     if(d[i][j]==INF){
  //       cout<<-1<<" ";
  //     }else cout<<d[i][j]<<" ";
  //   }
  //   cout<<endl;
  // }

  // out(d[gy][gx]);


  return 0;
}


Measured memory_bytes: 256
/* Author rumoisen */
/* date 2018/10/07 */

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>
 
using namespace std;
 
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7
#define pb push_back

void no(){cout<<"No"<<endl;exit(0);}
void yes(){cout<<"Yes"<<endl;exit(0);}

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

using namespace std;

int main()
{
    ll n;
    int ans;
    cin>>n;
    bool kyuu=true;
    vector<int> n_;
    while(n>0){
        n_.pb(n%10);
        if(n>=10&&n_.back()!=9) kyuu=false;
        n/=10;
    }
    if(kyuu){
        ans=n_.back()+(n_.size()-1)*9;
    }
    else{
        ans=n_.back()-1+(n_.size()-1)*9;
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 384
#include<iostream>
using namespace std;
int ans,sum;
string s;
int main()
{
	cin>>s;
	for(int i=0;i<s.length();i++)
		if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T')sum++;
		else
		{
			ans=max(ans,sum);
			sum=0;
		}
	ans=max(ans,sum);
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,n,s) for(int i = s; i < (n); ++i)
#define rsrep(i,n,s) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<x<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;

int main() {
    int n, k;
    cin >> n >> k;
    ll ans = 0;
    if (k == 0) {
        cout << (ll)n*n << endl; 
        return 0;
    }
    for (int b = 1; b <= n; ++b) {
        if (b <= k) continue;
        ans += (b-k) * ((n+1)/b);
        ans += max(0, (n+1)%b-k);
    }

    cout << ans << endl;
    return 0;
}

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

int main() {
   // freopen("in.txt", "r", stdin);
    long long int n, m, l, a[101][101] = {0}, b[101][101] = {0}, c[101][101] = {0};
    cin >> n >> m >> l;

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            cin >> a[i][j];
        }
    }
    for (int i = 0; i < m; ++i) {
        for (int j = 0; j < l; ++j) {
            cin >> b[i][j];
        }
    }

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < l; ++j) {
            for (int k = 0; k < m; ++k) {
                c[i][j] += a[i][k] * b[k][j];
            }
        }
    }

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < l; ++j) {
            cout << c[i][j];
            if (j != l - 1) {
                cout << " ";
            }
        }
        cout << endl;
    }
}

Measured memory_bytes: 3356
N = int(input())
S = [0 if _ == 'W' else 1 for _ in input()]
array = [0] * N
if S[0] == 0 or S[-1] == 0:
    print(0)
    exit()
cl = 1
ans = [0]
for i in range(1, 2 * N):
    if S[i] == S[i - 1]:
        ans += [1]
        S[i] = 1 - S[i]
    else:
        ans += [0]
x = 1
c = 0
mod = 10**9 + 7
for a in ans:
    if a:
        x *= c
        x %= mod
        c -= 1
    else:
        c += 1
if c == 0:
    for i in range(2, N + 1):
        x *= i
        x %= mod
    print(x)
else:
    print(0)


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

using namespace std;

int main(){
    int i,ok=1,n,x;

    cin>>n;

    for(i=1;i<=n;i++){
        cin>>x;
        if(x%2==0 && !(x%5==0 || x%3==0))
            ok=0;
    }

    if(ok)
        cout<<"APPROVED";
    else
        cout<<"DENIED";

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std; 
  
typedef long long int ll; 
typedef pair<int, int> pii; 
typedef pair<ll, ll> pll; 
typedef pair<string, string> pss; 
typedef vector<int> vi; 
typedef vector<vi> vvi; 
typedef vector<pll> vll; 
typedef vector<ll> vl; 
typedef vector<vl> vvl; 
  
double EPS = 1e-9; 
long long INF = 1000000000000000005ll; 
double PI = acos(-1); 
#define M 1000000007ll
#define D 998244353ll
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define oset tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound  
#define SQR(x) ((LL)(x) * (x)) 
#define RESET(a, b) memset(a, b, sizeof(a))
#define GCD(a,b) __gcd(a,b)
#define setbits(x)   __builtin_popcountll(x)
#define zerobits(x)  __builtin_ctzll(x) 
#define ps(x,y)  fixed<<setprecision(y)<<x
#define endl '\n'
#define ff first 
#define ss second 
#define mp make_pair  
#define ALL(v) v.begin(), v.end() 
#define ALLA(arr, sz) arr, arr + sz 
#define SIZE(v) (int)v.size() 
#define SORT(v) sort(ALL(v)) 
#define REVERSE(v) reverse(ALL(v)) 
#define SORTA(arr, sz) sort(ALLA(arr, sz)) 
#define REVERSEA(arr, sz) reverse(ALLA(arr, sz)) 
#define PERMUTE next_permutation 
  
inline string IntToString(ll a) 
{ 
    char x[100]; 
    sprintf(x, "%lld", a); 
    string s = x; 
    return s; 
} 
  
inline ll StringToInt(string a) 
{ 
    char x[100]; 
    ll res; 
    strcpy(x, a.c_str()); 
    sscanf(x, "%lld", &res); 
    return res; 
} 
  
 
inline string uppercase(string s) 
{ 
    int n = SIZE(s); 
    for(ll i=0;i<n;i++) 
    if (s[i] >= 'a' && s[i] <= 'z') 
        s[i] = s[i] - 'a' + 'A'; 
    return s; 
} 
  
inline string lowercase(string s) 
{ 
    int n = SIZE(s); 
    for(ll i=0;i<n;i++) 
    if (s[i] >= 'A' && s[i] <= 'Z') 
        s[i] = s[i] - 'A' + 'a'; 
    return s; 
}
ll a[100005];

int main() {
    FAST
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    ll a;
    cin>>a;
    cout<<a+a*a+a*a*a<<endl;
    return 0; 
}

Measured memory_bytes: 3568
import std.stdio;
import std.string;
import std.range;
import std.conv;

void main()
{
	auto N = readln.chomp.to!int;
	auto K = readln.chomp.to!int;
	auto X = readln.chomp.to!int;
	auto Y = readln.chomp.to!int;
	if(N>K){
		writeln((K*X)+((N-K)*Y));
	}else{
		writeln(N*X);
	}
}

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


#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define pli pair<long long,int>
#define pil pair<int,long long>
#define ll long long
#define el '\n'

using namespace std;

const int N = 110;
const int INF = 1e8;

pii nex[2] = {mp(1, 0), mp(0, 1)};

int r, c;
int n;
string s[N];

pii aw, ak;

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

    cin >> r >> c;
    for (int i=1;i<=r;i++){
        string temp;
        cin >> temp;
        s[i] = "*" + temp + "*";
    }
    aw = mp(1, 1);
    ak = mp(r, c);

    set <pair<int, pii>> setdah; // cost, pos
    int dp[r + 2][c + 2];
    for (int i=0;i<r + 2;i++){
        fill(dp[i], dp[i] + c + 2, INF);
    }
    dp[aw.fi][aw.se] = 0;
    for (int i=1;i<=r;i++){
        for (int j=1;j<=c;j++){
            setdah.insert(mp(dp[i][j], mp(i, j)));
            // cout << i << " " << j << el;
        }
    }

    while (!setdah.empty()){
        auto temp = *setdah.begin();
        // cout << temp.fi << " " << temp.se.fi << ", " << temp.se.se << el;
        pii cur = temp.se;
        int cost = temp.fi;
        setdah.erase(setdah.begin());

        for (int i=0;i<2;i++){
            int ni = cur.fi + nex[i].fi;
            int nj = cur.se + nex[i].se;
            if (ni > 0 && nj > 0 && ni <= r && nj <= c){
                int tambah = (s[cur.fi][cur.se] != s[ni][nj]);
                if (cost + tambah < dp[ni][nj]){
                    // pair<int, pii> baru = mp(cost + tambah, mp(ni, nj));
                    setdah.erase(mp(dp[ni][nj], mp(ni, nj)));
                    dp[ni][nj] = cost + tambah;
                    setdah.insert(mp(dp[ni][nj], mp(ni, nj)));
                }
            }
        }
    }

    if (s[1][1] == s[r][c] && s[1][1] == '.') cout << dp[ak.fi][ak.se] / 2 << el;
    else if (s[1][1] == s[r][c]) cout << dp[ak.fi][ak.se] / 2 + 1 << el;
    else cout << (dp[ak.fi][ak.se] - 1) / 2 + 1 << el;

    return 0;
}

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

int main()
{
	long int A, B, C, K;
	long int sum = 0;

	cin >> A >> B >> C >> K;

	while (A > 0 && K > 0)
	{
		sum++;
		A--;
		K--;
	}
	while (B > 0 && K > 0)
	{
		B--;
		K--;
	}
	while (C > 0 && K > 0)
	{
		sum--;
		C--;
		K--;
	}
	cout << sum << endl;
}

Measured memory_bytes: 3628
M,z,s=998244353,1,0
d=[1]+[0]*7**6
e=[1]+[0]*7**6
for _ in'_'*input():
 a=input();s+=a;i=s;z*=3
 while~i:d[i]+=d[i]+d[i-a]%M;e[i]+=e[i-a]%M;i-=1
i=s
while i*2>=s:z-=d[i]*3;i-=1
print(z+~s%2*e[s//2]*3)%M

Measured memory_bytes: 157752
def maxim(S,N,M,A,j,ans):
    way=0
    for i in range(j,M+1):
        A.append(i)
        #print(A)
        if(len(A)==N):
            #print(A)
            for k in S:
                #print(k)
                if(A[k[1]-1]-A[k[0]-1]==k[2]):
                    way+=k[3]
                else:
                    pass
                #print(way)
            if(way>ans):
                ans=way
            else:
                pass
            way=0
            #print(ans)
        else:
            way=maxim(S,N,M,A,i,ans)
            #print(way)
            #print(A)
            if(way>ans):
                ans=way
            else:
                pass
            way=0
        A.pop(len(A)-1)
        #print(A)
    return ans

N,M,Q=map(int,input().split())
S=[]
A=[]
for i in range(Q):
    S.append(list(map(int,input().split())))
ans=0
ans=maxim(S,N,M,A,1,ans)
print(ans)

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

using ll = long long;
using Field = vector<vector<ll>>;
using Graph = vector<vector<ll>>;
using VI = vector<int>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VC = vector<char>;
using PI = pair<int, int>;

#define FOR(i, s, n) for (int i = s; i < (n); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define ALL(x) x.begin(), x.end()

const long long INF = 1LL<<60;
const int mod = 1000000007;

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

int a, b;

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

    cin >> a >> b;
    cout << a * b << endl;

    return 0;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define all(x) x.begin(),x.end()
#define sz(x) (ll)x.size() 

ll power(ll x,ll y,ll p) 
{ 
    ll res = 1;      

    x = x % p;  

    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
  
        y = y>>1; 
        x = (x*x) % p;   
    } 
    return res; 
} 

int main()
{
    ios_base::sync_with_stdio(false);
	ll n,i,j,k,x,y,t,m;

    cin >> n;
    string s1,s2;
    cin >> s1 >> s2;
    for(i=0;i<n;i++)
    {
        cout<<s1[i]<<s2[i];
    }
    cout<<endl;
}

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

int main(){
	int n, m;
	cin >> n >> m;
	
	int a;
      int day=0;
	for(int i=0; i<m; i++){
		cin >> a;
		day += a;
	}
	if(n-day<0) cout << -1 << endl;
	else cout << n - day << endl;
}

Measured memory_bytes: 3624
n, m, k = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
a = [0] + a
seen = []
runSum = 0
for i, val in enumerate(b):
    runSum += val
    seen.append((runSum, i))
seen.sort()
def findLessEqual(target):
    l, r = 0, len(seen) - 1
    result = -1
    resultVal = 0
    while l <= r:
        mid = (l + r) // 2
        if seen[mid][0] == target:
            return seen[mid][0], seen[mid][1]
        elif seen[mid][0] < target:
            resultVal, result = seen[mid][0], seen[mid][1]
            l = mid + 1
        else:
            r = mid - 1
    return resultVal, result

runSum = 0
result = 0
for i, val in enumerate(a):
    runSum += val
    if runSum <= k:
        complement = k - runSum
        compVal, compI = findLessEqual(complement)
        if compVal + runSum <= k:
            result = max(result, i + compI + 1)
        else:
            result = max(result, i)
print(result)


Measured memory_bytes: 126632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pint = pair<int,int>;
ll mod = 1000000007,mod2 = 998244353;

void chmin(long long &a, long long b) { if (a > b) a = b; }
const long long INF = 1LL<<60;
ll gcd(ll a,ll b){
    if(b == 0) return a;
    else return gcd(b,a%b);
}

int dig(int n){
    int keta = 0;
    while(n > 0){
        n /= 10;
        keta++;
    }
    return keta;
}

int main() {
    int x;
    cin >> x;
    int ans;
    for (int i = 0; i <= x; ++i) {
        if(i*(i+1)/2 >= x){
            ans = i;
            break;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
const long long INF = LLONG_MAX / 2;
#define FOR(i, r, n) for(int i=(r); i<(n); i++) 
#define REP(i, n) FOR(i, (0), n)
#define ll long long int

template <typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
	vector.erase(vector.begin() + index);
}

using namespace std;
ll ans = 0, sum = 0, n, k, t;
string s;

ll counter = 3;

ll a, b, c;

int main()
{
	cin >> a >> b >> c;
	if (a == b || b == c || a == c)
	{
		counter--;
	}
	if (a == b&&b == c&&a == c)
	{
		counter--;
	}
	cout << counter << endl;
}

Measured memory_bytes: 256
A,B = list(map(int, input().split()))

range = B - (A - 1)

result = 0

if A % 2 == 1:
    range -= 1
    result = A

if B % 2 == 0:
    range -= 1
    result ^= B


if range % 4 != 0:
    result ^= 1

print(result)

Measured memory_bytes: 3060
N = int(input())
S = input()
ans = 0
for i in range(N):
    d1 = {}
    d2 = {}
    S1 = S[:i]
    S2 = S[i:]
    subans = 0
    for s in S1:
        d1[s] = True
    for s in S2:
        d2[s] = True
    for key in d1:
        if key in d2:
            subans += 1
    ans = max(ans, subans)
print(ans)
    
    

Measured memory_bytes: 3064