akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<iomanip>
#include<bitset>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

const int MAX = 5100000;
const int MOD = 1000000007;


int main(){
  map<ll,ll> m;
  ll N; cin >> N;
  for(ll i = 2; i * i <= N ; i++){
    while(N % i == 0){
      m[i]++;
      N /= i;
    }
  }
  if(N != 1) m[N]++;

  vector<ll> a(50);
  rep(i,50){
    a[i] = (i) * (i + 1) / 2;
  }

  ll ans = 0;
  for(auto p : m){
    // cout << p.fi << " " << p.sc << endl;
    ans += POSL(a,p.sc);
    ans --;
    if(p.sc == a[POSL(a, p.sc)]) ans++;
  }
  cout << ans << endl;
}


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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

#define ASSERT(expr...) assert((expr))

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;
using ll = long long;

constexpr i64 INF = 1010000000000000017LL;

constexpr i64 MOD = 1000000007LL;

constexpr f64 EPS = 1e-12;

constexpr f64 PI = 3.14159265358979323846;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) {
        xmax = x;
        return true;
    }
    return false;
}

template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) {
        xmin = x;
        return true;
    }
    return false;
}

struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;

ll mod_pow(ll x, ll n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        return mod_pow(x * x % MOD, n / 2) % MOD;
    } else {
        return x * mod_pow(x, (n - 1)) % MOD;
    }
}

ll mod_pow_r(ll x, ll n) {
    if (x == 0) return 0;
    if (n == 0) return 1;

    ll ret = 1;
    while (n) {
        if (n & 1) ret = ret * x % MOD;
        x = x * x % MOD;
        n /= 2;
    }
    return ret;
}

ll factorial(ll n) {
    ll ret = 1;
    REP(i, n) {
        ret *= (i + 1);
        ret %= MOD;
    }
    return ret;
}

ll combination(ll n, ll r) {
    if (n < 0 || n < r || r < 0) return 0;
    ll fn = factorial(n);
    ll fr = factorial(r);
    ll fn_r = factorial(n-r);

    ll d = (mod_pow(fr, MOD - 2) * mod_pow(fn_r, MOD - 2)) % MOD;
    ll u = fn % MOD;
    return u * d % MOD;
}

int n, m;
int a[110];

void solve() {
    cin >> n >> m;
    REP(i, n) cin >> a[i];

    sort(a, a+n, greater<>());
    auto sum = accumulate(a, a+n, 0);
    bool able = true;
    if (a[m-1] * 4 * m < sum) able = false;

    if (able) cout << "Yes";
    else cout << "No";
}

signed main() {
    solve();
    return 0;
}

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

#define int long long
#define ll unsigned long long
#define pb push_back
#define mp make_pair
#define reset(a, b) memset(a, b, sizeof(a))
#define rep(i,b) for(int i=0; i<b; i++)
#define F first 
#define S second
/*----------------------------------------*/

 

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    int T;
    T=1;
//    cin>>T;

    while(T--){
       
       int a, b, c, k;
       cin>>a>>b>>c>>k;
       
       
       int sum=0;
       
       if(k<=a){
           cout<<k;
           continue;
       }
       sum=a;
       k=k-a;
       if(k<=b){
           cout<<sum;
           continue;
       }
       k-=b;
       sum+=(k*-1);
       cout<<sum;
       
    }
    return 0;
}

Measured memory_bytes: 3640
import sys
input=sys.stdin.readline
n=int(input())
names=[input() for i in range(n)]
march=[0]*5
MARCH={j:i for i,j in enumerate('MARCH')}
for i in range(n):
    if names[i][0] in 'MARCH':
        march[MARCH[names[i][0]]]+=1
ans=0
for  i in range(5):
  for j in range(i+1,5):
    for k in range(j+1,5):
      ans+=march[i]*march[j]*march[k]      
print(ans)

Measured memory_bytes: 9880
#include<bits/stdc++.h>
#define MAX 507
using namespace std;
int h, w;
char a[MAX][MAX], b[MAX][MAX], c[MAX][MAX];
int main()
{
	int i, j;
	scanf("%d%d", &h, &w);
	getchar();
	memset(a, '.', sizeof(a));
	memset(b, '.', sizeof(b));
	for(i = 1; i <= h; i++)scanf("%s", c[i] + 1);
	for(i = 1; i <= h; i += 2)
	{
		for(j = 2; j <= w; j++)a[i][j] = '#';
		b[i][1] = '#';
	}
	for(i = 2; i <= h; i += 2)
	{
		for(j = 1; j < w; j++)b[i][j] = '#';
		a[i][w] = '#';
	}
	for(i = 1; i <= h; i++)
	for(j = 1; j <= w; j++)
	if(c[i][j] == '#')a[i][j] = b[i][j] = '#';
	for(i = 1; i <= h; i++)
	{
		for(j = 1; j <= w; j++)printf("%c", a[i][j]);
		printf("\n");
	}
	printf("\n");
	for(i = 1; i <= h; i++)
	{
		for(j = 1; j <= w; j++)printf("%c", b[i][j]);
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 1536
#include<bits/stdc++.h>
using namespace std;
int N;
vector<vector<int> > edges;
vector<long long> calcDistances(const int start) {
    vector<long long> distances(N+1, -1);
    queue<int> current;
    distances[start] = 0;
    current.push(start);
    while (!current.empty()) {
        int a = current.front();
        for (int i = 0; i < (int)edges[a].size(); ++i) {
            auto b = edges[a][i];
            if (distances[b] == -1) {
                distances[b] = distances[a]+1;
                current.push(b);
            }
        }
        current.pop();
    }
    return distances;
}
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin >> N;
    edges.resize(N+1);
    int u, v;
    cin >> u >> v;
    for (int i = 0; i < N-1; i++) {
        int a, b;
        cin >> a >> b;
        edges[a].push_back(b);
        edges[b].push_back(a);
    }
    auto du = calcDistances(u), dv = calcDistances(v);
    long long ans = 0;
    for (int i = 0; i < N; ++i) {
        if (du[i+1] <= dv[i+1]) ans = max(ans, dv[i+1]-1);
    }
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 7424
#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
constexpr ll INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
constexpr ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a, b, c, d, tmp, m, h, w, x, y, k, q;
ll fr[ohara], ba[ohara], tmpp;

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

  cin >> n >> k;
  fr[1] = 0;
  tmpp = n - 1;
  ba[1] = n;
  rrep(i, 2, n + 2) {
    fr[i] = i - 1;
    ba[i] = tmpp;
    tmpp--;
  }
  rrep(i, 2, ohara) fr[i] += fr[i - 1], ba[i] += ba[i - 1];
  rrep(i, k, n + 2) {
    cnt = ba[i] - fr[i] + 1;
    ans += cnt;
    ans %= MOD;
    // debug(ans);
  }
  Cout(ans);
  return 0;
}

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

typedef long long ll;
#define pa pair<int, int> 
#define pal pair<long long, long long>
#define pali pair<long long, int>
#define pad pair<double, double>
#define pb push_back
#define mp make_pair 
#define COUT(v) for(int64_t i=0;i<(v).size();i++){ cout << v.at(i) << endl;}
#define REP(i, n) for(int64_t i=0;i<n;i++)
#define VIN(v) for(int64_t i=0;i<(v).size();i++){cin >> (v).at(i);}

typedef vector<bool> bvec;
typedef vector<int> ivec;
typedef vector<long long> lvec;
typedef vector<double> dvec;
typedef vector<pa> pavec;
typedef vector<pali> palivec;
typedef vector<pal>palvec;


typedef vector< vector<bool> > bmat;
typedef vector< vector<int> > imat;
typedef vector< vector<long long> > lmat;

typedef vector<string> svec;
typedef vector< vector<string> > smat;
const ll infll = (1LL << 60) - 1;
const int inf = (1 << 30) - 1;
const int MOD = 1000000007;


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

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

lvec mfactor(ll n){
    bvec ip(n, true);
    lvec mf(n, -1);
    ip[0]=false; ip[1]=false; mf[0]=0; mf[1]=1;
    REP(i, n){
        if(ip[i]){
            mf[i] = i;
            for(ll j=i*i; j<n; j+=i){
                ip[j] = false;
                if(mf[j] == -1) mf[j]=i;
            }
        }
    }
    return mf;
}

palivec get_prime(ll n, const lvec &mf){
    palivec plist;
    while(n != 1){
        int cnt=0;
        ll m=mf[n];
        while(mf[n] == m){
            cnt++;
            n/=m;
        }
        plist.pb(pali(m, cnt));
    }
    return plist;
}

void COMinit(int m, lvec &fac, lvec &finv){
    lvec inv(m);
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < m; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll COM(int n, int k, const lvec& fac, const lvec &finv){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    ll MAX =5*1e5+1;
    lvec fac(MAX), finv(MAX);
    COMinit(MAX, fac, finv);
    ll ans=0;
    REP(i, min(n, k+1)){
        ans+=COM(n, i, fac, finv)*COM(n-1, n-i-1, fac, finv) % MOD;
    }
    cout << ans%MOD<< endl;
}

Measured memory_bytes: 12032
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
 
int main(){
    long long int a, b, c;
    cin >> a >> b >> c;
    if (c-a-b > 2 * sqrtl(a*b)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

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

using namespace std;

vector<pair<int, int>> calcPref(string s, int c) {
    int n = s.length();
    vector<pair<int, int>> ans(n);
    pair<int, int> start = {0, -2*c};
    for (int i = 0; i < n; i++) {
        auto prev = i == 0 ? start : ans[i-1];
        auto cur = s[i] == 'o'
            ? make_pair((i > c ? ans[i-c-1].first : 0) + 1, i)
            : start;
        ans[i] = cur.first > prev.first ? cur : prev;
    }
    return ans;
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int n, k, c;
    cin >> n >> k >> c;
    string s;
    cin >> s;
    auto pref = calcPref(s, c);
    reverse(s.begin(), s.end());
    auto suf = calcPref(s, c);
    reverse(suf.begin(), suf.end());
    vector<int> res;
    reverse(s.begin(), s.end());
    for (int i = 0; i < n; i++) {
        int from = i+1;
        int before = 0;
        if (i > 0) {
            before = pref[i-1].first;
            from = max(pref[i-1].second + c + 1, from);
        }
        int after = from < n ? suf[from].first : 0;
        if (after + before < k && s[i] == 'o') {
            res.push_back(i);
        }
    }
    for (int v: res) {
        cout << v+1 << "\n";
    }
}



Measured memory_bytes: 5832
#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main() {
  string S;
  cin >>S;

 if(S>"2019/04/30") {
cout << "TBD" << endl;
 }
  else {
cout << "Heisei" << endl;
  }
}
    


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

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

using namespace std;

int main()
{
    char X, Y; cin >> X >> Y;

    if( X == Y )
        cout << "=" << endl;
    else if( X < Y )
        cout << "<" << endl;
    else
        cout << ">" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct Fast {
    Fast() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} fast;
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
long long mod = 1000000007;
#define REP(i, n) for (long long i = 0; i < (n); i++)
#define rep(i, a, n) for (long long i = a; i < (n); i++)
long long modpow(long long m, long long n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        long long t = modpow(m, n / 2);
        return (t * t) % mod;
    } else {
        return (modpow(m, n - 1) * m) % mod;
    }
}

template <typename A, size_t N, typename T> void Fill(A (&array)[N], const T& val) {
    std::fill((T*)array, (T*)(array + N), val);
}
// long long mod = 998244353;
long long power(long long m, long long n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        long long t = modpow(m, n / 2);
        return t * t;
    } else {
        return modpow(m, n - 1) * m;
    }
}

long long moddiv(long long a, long long b) { return (a * modpow(b, mod - 2)) % mod; }

const ll INF = 1LL << 60;

void print_binary(long long a) {
    for (int i = 31; i >= 0; i--) {
        cout << (a >> i & 1);
    }
    cout << endl;
}

ll nCkmod(ll n, ll k) {
    ll denomi = 1;
    for (int i = n; i > n - k; i--) {
        denomi *= i;
        denomi %= mod;
    }
    ll numera = 1;
    REP(i, k) {
        numera *= (i + 1);
        numera %= mod;
    }
    return moddiv(denomi, numera);
}
map<ll, ll> cnt;
void primeFactors(long long n) {
    while (n % 2 == 0) {
        cnt[2]++;
        n = n / 2;
    }
    for (int i = 3; i <= sqrt(n); i = i + 2) {
        while (n % i == 0) {
            cnt[i]++;
            n = n / i;
        }
    }
    if (n > 2) {
        cnt[n]++;
    }
}
int main() {
    ll n, p;
    cin >> n >> p;
    primeFactors(p);
    ll ans = 1;
    for (auto x : cnt) {
        ans *= power(x.first, (x.second / n));
    }
    cout << ans << endl;
}

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

int main(){
int N,K;
cin>>N;
string S(N,'-');
cin>>S>>K;
K=S[K-1];
for(int i=0;i<N;i++){
if(S[i] != K){
S[i] = '*';
}
}

cout<<S;

return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m1(x) memset(x,-1,sizeof(x))
const int INF = 1e9 + 1;
const ll MOD = 1e9 + 7;
const double PI = 3.141592653589793;

//UnionFind

struct UnionFind{
  vector<int> d;

//コンストラクタ
  UnionFind(int n = 0): d(n, -1){};
//

  int find(int x){
    if(d[x] < 0) return x;
    return d[x] = find(d[x]);
  }

  bool unite(int x, int y){
    x = find(x); y = find(y);
    if(x == y) return false;
    if(d[x] > d[y]) swap(x, y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }

  bool same(int x, int y){
    return find(x) == find(y);
  }

  int size(int x){
    return -d[find(x)];
  }

};

int main(){
  ll n, m;
  cin >> n >> m;
  UnionFind uf(n);
  stack<ll> st;
  st.push(n*(n-1)/2);
  stack<pair<ll, ll>> bridge;
  rep(i, m){
    ll a, b;
    cin >> a >> b;
    a--;b--;
    bridge.push(make_pair(a, b));
  }
  for(int i = 0; i < m; i++){
    ll a = bridge.top().first, b = bridge.top().second; 
    bridge.pop();
    if(uf.same(a, b)){
      st.push(st.top());
      continue;
    }
    ll tmp = st.top() - uf.size(a) * uf.size(b);
    st.push(tmp);
    uf.unite(a, b);
  }
  st.pop();
  while(st.size()){
    cout << st.top() <<endl;
    st.pop();
  }
}
  

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

int main() {
    string s;
    cin >> s;

    for (int s_i = 0; s_i < s.size(); s_i++) {
        if (s_i + 1 < s.size() && s[s_i] == s[s_i + 1]) {
            cout << s_i + 1 << " " << s_i + 2 << endl;
            return 0;
        }
        if (s_i + 2 < s.size() && s[s_i] == s[s_i + 2]) {
            cout << s_i + 1 << " " << s_i + 3 << endl;
            return 0;
        }
    }

    cout << -1 << " " << -1 << endl;
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int) n; i++)

int main() {
    string s; cin >> s;
    vector<bool> found(26, false);
    rep(i,s.size()) {
        found[s[i]-97] = true;
    }
    rep(i,26) {
        if (!found[i]) {
            cout << char(i+97) << endl;
            return 0;
        }
    }
    cout << "None\n";
    return 0;
}

Measured memory_bytes: 512
const input = require('fs').readFileSync('/dev/stdin', 'utf8');

const arr = input.split(' ');

const a = Number(arr[0]);

const b = Number(arr[1]);

const c = Number(arr[2]);

if (a * c <= b) {
  console.log(c);
} else {
  console.log(Math.floor(b/a));
}

Measured memory_bytes: 7372
#include<bits/stdc++.h>
#include<string>
#define FIO ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define ll long long
#define mod (ll)(1e9+7)
#define nax (ll)(1e5)
#define INFL LLONG_MAX
#define INF INT_MAX
#define disp(a,n,arr) for(int i=a;i<(ll)n;i++) cout << arr[i] << " "; cout << "\n";
#define check cout << "Working\n";
#define pi pair<int,int>
#define pl pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define vpl vector<pl>
#define vpi vector<pi>
#define vb vector<bool>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;



int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	FIO;

	// Write your code here

	int t = 1;
	//cin >> t;
	while (t--) {
		ll a;
		cin >> a;
		cout << a + a*a + a*a*a << "\n";
	}


	return 0;
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
void RLblock(int s, int t, int r){
int c=t-s+1, d;
for(int i=s; i<s+c; i++){ 
 if(i==r){ d=(c%2)?c/2+(r+s+1)%2:c/2; } 
 else if(i==r+1){ d=(c%2)?c/2+(r+s)%2:c/2; }
 else{ d=0; }
 cout << d << ' '; 
}
}
int main(){
string S; cin >> S; int N=S.size(), s, t, r, i=0;
while(i<N){
 for(s=i; S[i]=='R'; i++);
 for(r=i-1; S[i]=='L' && i<N; i++);
 t=i-1; RLblock(s, t, r);
}
}

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

int main(void) {
  int i;
  string o, e;
  cin >> o >> e;
  for(i = 0;i < e.size();i++) {
    cout << o.at(i) << e.at(i);
  }
  if(o.size() != e.size()) {
    cout << o.at(i);
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cmath>
using namespace std;
typedef long long int llint;

int main(){
	llint A,B,C,K;
	cin >> A >> B >> C >> K;
	if(abs(A-B)>pow(10,18)){
		cout << "Unfair" << endl;
	}else{
		if(K%2==0){
			cout << (A-B) << endl;
		}else{
			cout << (B-A) << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define ll              long long
#define pb              push_back
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)      __builtin_ctzll(x)
#define mod             998244353
#define Mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define vpii            vector<pair<int,int> >
#define all(x)          x.begin(),x.end()
#define gcd(m,n)        __gcd(m,n)
#define matrixprint(arr,a,b,c,d) for(int i=a;i<=c;i++){for(int j=b;j<=d;j++){cout<<arr[i][j]<<" ";}cout<<"\n";}
#define show(arr,x,y)   for(int i=x;i<=y;i++){cout<<arr[i]<<" ";}cout<<"\n"
#define sz               size()
#define inc(i,x,y)      for(int i=x;i<=y;i++)
#define dec(i,x,y)      for(int i=x;i>=y;i--)



#define TRACE
#ifdef TRACE
#define deb(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << std::endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define deb(...)
#endif

void fast()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//#ifndef ONLINE_JUDGE
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//#endif
}

//////////////////////////////code//////////////////////////////
vi arr(100001);
vi adj[100001];
int ctr;
int vis[100001];

void dfs(int node)
{
    vis[node]++;

    int f=0;
    
   //deb(node);
   
    for(int i=0;i<adj[node].size();i++)
    {
       if(arr[adj[node][i]]>=arr[node])
        f=1;

         if(!vis[adj[node][i]])
            dfs(adj[node][i]);
     }

     if(f==0)
     {
     ctr++;
    // deb(f,node);
     }

}

int32_t main()
{
  fast();
  memset(vis,0,sizeof(vis));
  int n,m;
  cin>>n>>m;

  inc(i,1,n) cin>>arr[i];

  
  inc(i,0,m-1)
  {
      int u,v;
      cin>>u>>v;

        adj[u].pb(v);
        adj[v].pb(u);
  }



   ctr=0;
   //deb(adj[5].sz);
  for(int i=1;i<=n;i++)
   { //deb(i,vis[i],vis[6]);
   	 if(!vis[i])
   	  dfs(i);
   }

cout<<ctr;
}


Measured memory_bytes: 12160
#include<bits/stdc++.h>
#define rep(i,s,t) for(int i=s;i<=t;i++)
#define per(i,s,t) for(int i=s;i>=t;i--)

using namespace std;

int n,now,ans=1;
int a[100010];

int main(){
	scanf("%d",&n);
	rep(i,1,n) scanf("%d",&a[i]);
	if(a[1]<a[2]) now=1; else
	if(a[1]>a[2]) now=2; else now=0;
	rep(i,2,n){
		if(now==0){
			if(a[i]>a[i-1]) now=1;
			if(a[i]<a[i-1]) now=2;
			continue;
		}
		if(a[i]<a[i-1]&&now==1){now=0; ans++; continue;}
		if(a[i]>a[i-1]&&now==2){now=0; ans++; continue;}
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 640
n, m, q = map(int, input().split())
city = [[0]*(n+2) for _ in range(n+2)]
same = [0]*(n+1)
for _ in range(m):
    l, r = map(int, input().split())
    city[r][1] += 1
    city[r][l+1] -= 1

    city[1][r] += 1
    city[l+1][r] -= 1
    if l==r:
        same[l] += 1

"""
print()
for c in city[1:n+1]:
    print(c[1:n+1])
"""

for j in range(n+2):
    for i in range(1, n+2):
        city[j][i] += city[j][i-1]

for i in range(n+2):
    for j in range(1, n+2):
        city[j][i] += city[j-1][i]

"""
print()
for c in city[1:n+1]:
    print(c[1:n+1])
"""

for _ in range(q):
    x, y = map(int, input().split())
    if x==y:
        print(same[x])
    else:
        print(city[x][y])


Measured memory_bytes: 13168
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=500000004;
const double EPS=1e-6;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
int sum[110000];
bool pr(int a){
	for(int i=2;i*i<=a;i++){
		if(a%i==0)return false;
	}
	return true;
}
int main(){
	for(int i=3;i<101000;i++){
		if(i%2==1&&pr(i)&&pr((i+1)/2))sum[i]++;
	}
	for(int i=0;i<101000;i++)sum[i+1]+=sum[i];
	int a;scanf("%d",&a);
	while(a--){
		int p,q;scanf("%d%d",&p,&q);
		p--;
		printf("%d\n",sum[q]-sum[p]);
	}
}

Measured memory_bytes: 896
from fractions import gcd
K = int(input())
res = 0
dp = {}
for a in range(K+1)[1:]:
  for b in range(K+1)[1:]:
    i = a
    j = b
    if b < a:
      i = b
      j = a
    if not i + j * (K+1) in dp:
      dp[i + j * (K+1)] = gcd(i, j)
    
    d = dp[i + j * (K+1)]

    for c in range(K+1)[1:]:
        

      s = c
      t = d
      if d < c:
        s = d
        t = c
      
      if not s + t * (K+1) in dp:
        dp[s + t * (K+1)] = gcd(s, t)
      res += dp[s + t * (K+1)]

print(res)

Measured memory_bytes: 77828
import math

A, B, C = map(int, input().split())
K = int(input())

X0 = math.log2(B/A)
Y0 = math.log2(C/B)

def get_num(x):
    if x<=0:
        return int(-x) + 1
    else:
        return 0

n = get_num(X0)
Y_ = Y0 - n
m = get_num(Y_)


print("Yes" if n+m <= K else "No")



Measured memory_bytes: 9252
I = ["{0:03d}".format(int(n)) for n in open(0).read().split()]
c = 0
min_z = 10
for i in I:
    x, y, z = map(int, i)
    if 0 < z < min_z:
        min_z = z
    if 0 < z:
        y +=1
    if 9 < y:
        x += 1
        y -= 10
    n = x * 100 + y * 10
    c += n

print(c+min_z-10)

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

A = []
B = []

for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

A.reverse()
B.reverse()

ans = 0
before = 0

for i in range(N):
    mod = (A[i]+ans)%B[i]
    if mod != 0:
        ans += B[i]-mod

print(ans)

Measured memory_bytes: 11048
#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#include<string.h>
#include<iomanip>
using namespace std;
 
#define PI 3.14159265358979323846264338327950L
 
int main() {
	int S, W;

	cin >> S >> W;

	if (S <= W) {
		cout << "unsafe" << endl;
	} else {
		cout << "safe" << endl;
	}
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define all(a) a.begin(), a.end()
#define x first
#define y second
#define MOD 1000000007
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
  int n;
  cin >> n;
  cout << (n * (n + 1) / 2) << endl;
}

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  
  if (A + B > C + D ) {
    cout << "Left" << endl;
  }
  else if (A + B == C + D) {
    cout << "Balanced" << endl;
  }
  else {
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 3600
#include<cstdio>

int main(){
	int N;
	scanf("%d\n", &N);
	bool possibility[4][N], checker[4][2];
	for (int i = 0; i < 4; ++i){
		possibility[i][N - 1] = checker[i][0] = i & 1;
		possibility[i][0] = checker[i][1] = i & 2;
	}
	for (int i = 1; i <= N; ++i){
		char tmp;
		scanf("%c", &tmp);
		for (int j = 0; j < 4; ++j){
			possibility[j][i % N] = (tmp == 'o') ^ possibility[j][((i - 2 + N) % N)] ^ possibility[j][i - 1];
		}
	}
	for (int i = 0; i < 4; ++i){
		if(possibility[i][N - 1] == checker[i][0] && possibility[i][0] == checker[i][1]){
			for (int j = 0; j < N; ++j) printf("%c", possibility[i][j] ? 'S' : 'W');
			return 0;
		}
	}
	printf("-1");
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define int long long int
#define MOD(x) ((x % MOD_N) + MOD_N) % MOD_N
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define RFORE(i,a,b) for(int i=(b);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define RALL(c) (c).rbegin(),(c).rend()
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(c) (int)((c).size())
#define EACH(i,v) for(auto i=v.begin();i!=v.end();++i)
#define REACH(i,v) for(auto i=v.rbegin();i!=v.rend();++i)
#define LB(c,x) distance((c).begin(),lower_bound(ALL(c),x))
#define UB(c,x) distance((c).begin(),upper_bound(ALL(c),x))
#define COUNT(c,x) (lower_bound(ALL(c),x)-upper_bound(ALL(c),x))
#define UNIQUE(c) SORT(c); (c).erase(unique(ALL(c)),(c).end());
#define COPY(c1,c2) copy(ALL(c1),(c2).begin())
#define EXIST(s,e) (bool)((s).find(e)!=(s).end())
#define PB push_back
#define MP make_pair
#define DUMP(x)  cerr<<#x<<" = "<<(x)<<endl;
#define NL cerr<<endl;
using namespace std;
template<typename T,typename U> using P=pair<T,U>;
template<typename T> using V=vector<T>;
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>T sum(vector<T>&v){return accumulate(ALL(v),T());}
template<typename T>T sum(vector<T>&v,int a,int b){return accumulate(v.begin()+a,v.begin()+b,T());}
template<typename T>T max(vector<T>&v){return *max_element(ALL(v));}
template<typename T>T min(vector<T>&v){return *max_element(ALL(v));}
template<typename T>T max_index(vector<T>&v){return distance((v).begin(),max_element(ALL(v)));}
template<typename T>T min_index(vector<T>&v){return distance((v).begin(),min_element(ALL(v)));}

struct edge { int to, cost; };

template<typename T>auto&operator<<(ostream&s,const vector<T>&v){s<<"[";bool a=1;for(auto e:v){s<<(a?"":" ")<<e;a=0;}s<<"]";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const pair<T,U>&p){s<<"("<<p.first<<","<<p.second<<")";return s;}
template<typename T>auto&operator<<(ostream&s,const set<T>&st){s<<"{";bool a=1;for(auto e:st){s<<(a?"":" ")<<e;a=0;}s<<"}";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const map<T,U>&m){s<<"{";bool a=1;for(auto e:m){s<<(a?"":" ")<<e.first<<":"<<e.second;a=0;}s<<"}";return s;}

const int INF = 1e18;
const int MOD_N = 1e9+7;

signed main()
{
   int N, W; cin >> N >> W;
   V<int> v(N), w(N);
   REP(i, N) {
      cin >> v[i] >> w[i];
   }

   V<int> dp(sum(v)+1, INF);
   dp[0] = 0;
   REP(i, N) RREP(j, sum(v)) if (j + v[i] <= sum(v)) {
      chmin(dp[j + v[i]], dp[j] + w[i]);
   }
   RFORE(i, 0, sum(v)) if (dp[i] <= W) {
      cout << i << endl;
      return 0;
   }
   return 0;
}



Measured memory_bytes: 3148
#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++)
#define repr(i, n) for(int i=n-1; i>=0; i--)
#define repr1(i, n) for(int i=n; i>=1; i--)
#define all(v) v.begin(),v.end()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template<int MOD> struct modint {
    long long val;
    constexpr modint(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr modint operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr modint operator + (const modint& r) const noexcept { return modint(*this) += r; }
    constexpr modint operator - (const modint& r) const noexcept { return modint(*this) -= r; }
    constexpr modint operator * (const modint& r) const noexcept { return modint(*this) *= r; }
    constexpr modint operator / (const modint& r) const noexcept { return modint(*this) /= r; }
    constexpr modint& operator += (const modint& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr modint& operator -= (const modint& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr modint& operator *= (const modint& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr modint& operator /= (const modint& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const modint& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const modint& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const modint<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr modint<MOD> modpow(const modint<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};
using mint = modint<MOD>;

mint t[100010];

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

    mint ans = 0;
    for (int i = k; i >= 1; i--) {
        t[i] = modpow(mint(k/i), n);
        for (int j = i * 2; j <= k; j += i) {
            t[i] -= t[j];
        }
        ans += mint(i) * t[i];
    }
    cout << ans << endl;
}


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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef vector<vector<long long>> VVL;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef tuple<int,int,int> tpl;

#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define LB(a,x) lower_bound((a).begin(), (a).end(), x) - (a).begin()
#define UB(a,x) upper_bound((a).begin(), (a).end(), x) - (a).begin()

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

#define en "\n"

constexpr double EPS = 1e-9;
constexpr double PI  = 3.141592653589793238462643383279;
constexpr int INF = 2147483647;
constexpr long long LINF = 1LL<<60;
constexpr long long MOD = 1000000007; // 998244353

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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 main(void){
    int N; cin >> N; N <<= 1;
    string S; cin >> S;
    if(S[0]=='W' || S.back()=='W'){
        cout << 0 << endl;
        return 0;
    }

    VI d(N,0); d[0] = 1;
    REP(i,N-1) if(S[i+1]==S[i]) d[i+1] = d[i]^1; else d[i+1] = d[i];
    VL f(N,0); int nl = 0, nr = 0;
    REP(i,N){
        if(d[i] == 1) nl++;
        else{
            f[i] = max(0,nl-nr);
            nr++;
        }
    }
    if(nl != nr){
        cout << 0 << endl;
        return 0;
    }
    ll ans = 1;
    REP(i,N) if(d[i]==0) (ans *= f[i]) %= MOD;
    REP(i,N/2) (ans *= i+1) %= MOD;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2948
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		for (int i = 1; i <= n; i++) {
			if(String.valueOf(i).length() % 2 == 1){
				ans++;
			}
		}
		System.out.println(ans);
	}
}


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

int main() {
	ios::sync_with_stdio(false); cin.tie(0);
	int n; cin >> n;
	string s;
	unordered_set<string> st;
	for (int i = 0; i < n; i++) {
		cin >> s;
		st.insert(s);
	}
	cout << st.size() << endl;
	return 0;
}

Measured memory_bytes: 17628
//雪花飄飄北風嘯嘯
//天地一片蒼茫

#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define endl '\n'
#define debug(x) cout << #x << " is " << x << endl;

#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

ll MAX(ll a){return a;}
ll MIN(ll a){return a;}
template<typename... Args>
ll MAX(ll a,Args... args){return max(a,MAX(args...));}
template<typename... Args>
ll MIN(ll a,Args... args){return min(a,MIN(args...));}

#define indexed_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

int n;
ll c[26];
ll d[400][26];

ll calc(vector<int> &contest){
	ll last[26];
	
	memset(last,-1,sizeof(last));
	
	ll res=0;
	rep(x,0,n){
		res+=d[x][contest[x]];
		last[contest[x]]=x;
		
		rep(y,0,26) res-=c[y]*(x-last[y]);
	}
	
	return res;
}

//store curr best
ll best;
vector<int> ans;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	//freopen("sample2.in","r",stdin);
	
	auto begin_time=chrono::steady_clock::now().time_since_epoch().count();
	
	cin>>n;
	rep(x,0,26) cin>>c[x];
	
	rep(x,0,n){
		rep(y,0,26) cin>>d[x][y];
	}
	
	vector<int> curr;
	rep(x,0,n){
		curr.push_back(0);
	}
	
	ll val=calc(curr);
	
	best=val;
	ans=curr;
	
	while (chrono::steady_clock::now().time_since_epoch().count()-begin_time<1900000000){
		rep(zzz,0,330){ //try a few times to go to a smaller place
			int idx=rng()%n;
			int type=curr[idx];
			
			curr[idx]=rng()%26;
		
			ll temp=calc(curr);
			if (temp>val){
				val=temp;
				
				if (best<val){
					best=val;
					ans=curr;
				}
				
				goto ok;
			}
			else{
				curr[idx]=type;
			}
		}
		
		//cout<<"reached "<<val<<endl;
		
		//almost maxima. screw  around
		rep(x,0,3){
			curr[rng()%n]=rng()%26;
			val=calc(curr);
		}
		
		ok:;
	} 
	
	//pls uncomment later
	rep(x,0,n) cout<<ans[x]+1<<endl;
	
	//cout<<"debug: "<<best<<endl;
}


Measured memory_bytes: 3752
// Akshit Awasthi
#include <bits/stdc++.h>
#define int long long
#define float long double
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define all(x) x.begin(), x.end()
#define deb(...) cerr << "[" << #__VA_ARGS__ << ": " << (__VA_ARGS__) << "]\n"
#define deb2(x, y) cerr << #x << " = " << x << "\t" << #y << " = " << y << endl
#define fastio                    \
    std::ios::sync_with_stdio(0); \
    std::cin.tie(NULL);           \
    std::cout.tie(NULL)
#define mod1 1000000007
#define mod2 998244353
#define mod mod1
#define MAX 200015
using namespace std;

template <class T>
istream &operator>>(istream &stream, vector<T> &v) {
    for (int i = 0; i < (int)v.size(); i++)
        stream >> v[i];
    return stream;
}
template <class T1, class T2>
istream &operator>>(istream &stream, pair<T1, T2> &p) {
    return stream >> p.first >> p.second;
}
template <class T>
ostream &operator<<(ostream &stream, const vector<T> &v) {
    for (int i = 0; i < (int)v.size(); i++)
        stream << v[i] << ' ';
    stream << '\n';
    return stream;
}
template <class T1, class T2>
ostream &operator<<(ostream &stream, const pair<T1, T2> &pair) {
    return stream << pair.first << ' ' << pair.second;
}
int pow(int a, int n) {
    if (n < 0)
        return 0;
    int ans = 1;
    while (n) {
        if (n & 1)
            ans = ans * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return ans;
}
int __lcm(int a, int b) { return (a / __gcd(a, b)) * b; }
int fact(int n) { return n == 0 ? 1LL : n * fact(n - 1) % mod; }
int inverse(int x, int p = mod) { return pow(x, p - 2); }
int nck(int n, int k, int p = mod) {
    return fact(n) * inverse(fact(k), p) % p * inverse(fact(n - k)) % p;
}

void solve(void) {
    string s;
    cin >> s;
    int ans = 0;
    int curr = 0;
    for (int i = 0; i < 3; i++) {
        if (s[i] == 'R')
            curr++;
        else
            curr = 0;
        ans = max(ans, curr);
    }
    cout << ans;
}

int32_t main(void) {
#ifdef AKSHIT_PC
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
#endif
    fastio;
    // cout.setf(std::ios::unitbuf);
    int t = 1;
    // cin >> t;
    for (int i = 1; i <= t; i++) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3640
N = int(input())
A = list(map(int, input().split()))
def gcd(a, b):
    if a > b:
        while a % b != 0:
            a, b = b, a % b
        return b
    else:
        while b % a != 0:
            b, a = a, b % a
        return a
x = gcd(A[0], A[1])
for i in range(2, N):
    x = gcd(x, A[i])
print(x)


Measured memory_bytes: 14228
# -*- coding: utf-8 -*-
N = int(input())
U = []
for i in range(N):    
    x, l = (map(int,input().split()))
    u = [x+l,x-l]
    U.append(u)
U.sort()

ans = 1
x = U[0][0]
for i in range(N-1):
    if U[i+1][1] >= x:
        ans += 1
        x = U[i+1][0]
print(ans)

Measured memory_bytes: 20104
#include <bits/stdc++.h>
#define rep(i, N) for (int i = 0; i < (N); i++)
#define vec vector<int>
using namespace std;
int main()
{
    int N, sumA = 0, sumB = 0;

    cin >> N;
    vec a(N);
    rep(i, N)
    {
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    rep(i, N)
    {
        if (i % 2 == 0)
        {
            sumA += a[i];
        }
        else
        {
            sumB += a[i];
        }
    }
    cout << fabs(sumA - sumB) << endl;
}

Measured memory_bytes: 256
def prime_factor(n):
    factors = {}
    if n % 2 == 0:
        cnt = 0
        while n % 2 == 0:
            cnt += 1
            n //= 2
        factors[2] = cnt
    i = 3
    while i * i <= n:
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                cnt += 1
                n //= i
            factors[i] = cnt
        i += 2
    if n != 1:
        factors[n] = 1
    return factors

def combination(n, k, mod=10**9+7):
    numer = denom = 1
    for i in range(k):
        numer = numer * (n-i) % mod
        denom = denom * (i+1) % mod
    return numer * pow(denom, mod-2, mod) % mod

N, M = map(int, input().split())
mod = 10**9+7
ans = 1
for p, e in prime_factor(M).items():
    ans = ans * combination(e + N - 1, e) % mod
print(ans)

Measured memory_bytes: 38488
#include <stdio.h>
#include <string.h>

int main(void) {
  double gifts, x;
  int N;
  char u[4];
  for (scanf("%d",&N), gifts = 0.0; N && scanf("%lf%s",&x,&u); N--) {
    if (strcmp(u,"BTC")) {
      gifts += x;
    } else {
      gifts += x*380000.0;
    }
  }
  printf("%lf",gifts);
  return 0;
}


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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int N;
int A[222222],B[222222];

signed main(){
    int N;
    cin>>N;
    rep(i,N){
        cin>>A[i]>>B[i];
    }

    bool flag=true;
    rep(i,N)if(A[i]!=B[i])flag=false;
    if(flag){
        cout<<0<<endl;
        return 0;
    }


    int sum=accumulate(A,A+N,0ll);
    int ans=0;
    rep(i,N){
        if(A[i]<=B[i])continue;
        int tmp=2*sum-A[i]-B[i];
        tmp+=A[i]-B[i];
        chmax(ans,tmp/2);
    }

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


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, T;
  cin >> N >> T;
  
  vector<int> c(N), t(N);
  int S = 0;
  
  for (int i = 0; i < N; i++) {
    cin >> c.at(i) >> t.at(i);
    if (t.at(i) <= T) {
      S += 1;
    }
  }
  
  if (S == 0) {
    cout << "TLE" << endl;
  }
  
  else {
    vector<int> c2(S), t2(S);
    int j = 0;
    
    for (int i = 0; i < N; i++) {
      if (t.at(i) <= T) {
      c2.at(j) = c.at(i);
      t2.at(j) = t.at(i);
      j += 1;
      }
    }
    
    int index;
    int min = c2.at(0);
    
    for (int i = 0; i < S; i++) {
      if (c2.at(i) < min) {
        min = c2.at(i);
      }
    }
    cout << min << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)

int main(){
   int x,n;
   cin >> x >> n;
   vector<int> v(n);
   rep(i,n) cin >> v[i];
   int ans = -1;
   int d = 1000;
   for (int i = 0;i <= 101;i++){
      bool f = false;
      rep(j,n){
         if (i == v[j]) f = true; 
      }
      if (f) continue;
      else{
         if (abs(x-i) < d) {
            ans = i;
            d = abs(x-i);
         }
      }
   }
   cout << ans << endl;
}


Measured memory_bytes: 3612