akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define me BOSS
#define bug() cout<<"AIkahne aise"<<endl
#define PI acos(-1)
ll A[5000001],bin[5000001];
vector<ll>v;
map<int,int>myMap;
set<int>mySet;
vector<pair<ll,ll> >vp;
/* Precode Start Here *\



     Sieve
void sieve()
{
    for(ll i=3; i<=2000; i+=2)
    {
        for(ll j=i*i; j<=4000000; j+=i)
            A[j]=1;
    }
    v.push_back(2);
    for(ll i=3; i<=4000000; i+=2)
        if(A[i]==0)
            v.push_back(i);
}

     Power Function Modulo P

ll modPow(ll a, ll x, ll p) {
    //calculates a^x mod p in logarithmic time.
    long res = 1;
    while(x > 0) {
        if( x % 2 != 0) {
            res = (res * a) % p;
        }
        a = (a * a) % p;
        x /= 2;
    }
    return res;
}


   factorial

ll fact(ll n)
{
    ll ans=1;
    for(ll i=1;i<=n;i++)
    {
        ans=(ans*i)%mod;
    }
    return ans;
}
     Calculating nCr using Fermats law Theorem

ll modInverse(ll a, ll p) {
    //calculates the modular multiplicative of a mod m.
    //(assuming p is prime).
    return modPow(a, p-2, p);
}


ll modBinomial(ll n, ll k, ll p) {
// calculates C(n,k) mod p (assuming p is prime).

    ll numerator = 1; // n * (n-1) * ... * (n-k+1)
    for (ll i=0; i<k; i++) {
        numerator = (numerator * (n-i) ) % p;
    }

    ll denominator = 1; // k!
    for (ll i=1; i<=k; i++) {
        denominator = (denominator * i) % p;
    }

    // numerator / denominator mod p.
    return ( numerator* modInverse(denominator,p) ) % p;
}
     num of divisor and euler totient

ll phi[1000001],mark[1000001],divi[1000001];;
void divisorPhi(ll n)
{
    for(int i=1;i<=n;i++)
        phi[i]=i;
    for(int i=2;i<=n;i++)
    {
        if(!mark[i])
        {
            for(int j=i;j<=n;j+=i)
            {
                mark[j]=1;
                phi[j]*=(1-1/(double)i);
            }
        }
    }
    for(ll i=1;i<=n;i++)
    {
        for(ll j=i;j<=n;j+=i)
            divi[j]++;
    }
}




/* Precode Ends */
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
 ll n;
 cin>>n;
 string s,t,a;
 cin>>s;
 ll d=s.size();
 if(d%2==1)
 {
     cout<<"No"<<endl;
     return 0;
 }
 for(int i=0;i<s.size()/2;i++)
 {
     t+=s[i];
     a+=s[s.size()-i-1];
 }
 reverse(a.begin(),a.end());
 if(t==a)
 {
     cout<<"Yes"<<endl;
 }
 else
    cout<<"No"<<endl;
return 0;
}



Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <stack>
#include <functional>
#include <queue>
#include <cmath>
#include <set>
#include <map>

#define rep(i,j,k) for(int i=j;i<k;i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF 1000000000
#define MOD 1000000007
#define pb push_back
#define MP make_pair
typedef long long ll;
typedef std::pair<int,int> pii;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;

int main() {
    int n,k;
    cin>>n>>k;
    vector<int> v(n);
    rep(i,0,n)cin>>v[i];
    Sort(v);
    int ans=0;
    rep(i,0,k){
        ans+=v[n-i-1];
    }
    cout<<ans<<endl;
    return 0;
}


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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
// using Graph = vector<vector<int>>;
// グラフ表現
using Graph = vector<vector<pair<ll,ll>>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}

vector<ll> dis; 
vector<bool> seen;  // 訪問済みの点
bool flag = true;

void dfs(const Graph &G, int v, ll d) {
    seen[v] = true;
    dis[v] = d;
 
    for (auto next_v : G[v]) { 
        if (seen[next_v.first]){
            if(d+next_v.second != dis[next_v.first]){
                flag = false;
            }
            continue;
        }
        dfs(G, next_v.first, d+next_v.second); // 再帰的に値を追加していく
    }
}
int main()
{
    cout << fixed << setprecision(15);
    ll N, M;
    cin >> N >> M;

    Graph G(N);

    pair<ll,ll> p;
    ll a, b, c;

    REP(i, M){
        cin >> a >> b >> c;
        a--; b--;
        
        p.first = b;
        p.second = c;
        G[a].push_back(p);
        
        p.first = a;
        p.second = -1*c;
        G[b].push_back(p);
    }

    seen.assign(N, false);
    dis.assign(N, INF);
    // cout << "aaa" << endl;
    REP(i, N){
        if(!seen[i]){
            dfs(G, i, 0);
        }
    }
    

    if(flag){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 16512
from collections import deque, defaultdict


def bfs():
    adjacent = [(1, 0), (0, 1), (-1, 0), (0, -1)]  # 遷移先を網羅する
    cnt = defaultdict(int)
    hoge = 0
    while len(q):
        cx, cy = q.popleft()  # 現在の位置
        for a, b in adjacent:
            if 0 > cx+a or 0 > cy+b:
                continue
            if abs(cx+a) >= H or abs(cy+b) >= W:
                continue
            if visited[cx+a][cy+b]:
                continue
            if gridgraph[cx+a][cy+b] == "#":
                continue
            cnt[(cx+a, cy+b)] = cnt[(cx, cy)] + 1
            hoge = max(hoge, cnt[(cx+a, cy+b)])
            q.append((cx+a, cy+b))
            visited[cx+a][cy+b] = True
    return hoge


H, W = map(int, input().split())
gridgraph = [input() for _ in range(H)]
# print(gridgraph)

ans = 0
for i in range(H):
    for j in range(W):
        visited = [[False]*W for _ in range(H)]
        tmp = 0
        # 開始位置がi, j
        if gridgraph[i][j] == "#":
            continue
        q = deque()
        q.append((i, j))
        visited[i][j] = True
        ans = max(ans, bfs())

print(ans)


Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define INF 1000000000
#define mod 2
using ll=long long;
const ll LINF=1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}

int n;
//mCiを見る
bool f(vector<int> v){
    int m=n-1;
    vector<int> sum(m+2,0);
    for(int i=1;i<=m;i++){
        sum[i+1]=sum[i]+__builtin_ffs(i)-1;
    }
    int ret=0;
    for(int i=0;i<=m;i++){
        int si=sum[m+1]-sum[m+1-i];
        int bo=sum[i+1];
        if(si-bo==0) ret+=v[i]; 
    }    
    return ret%2;
}

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

    cin>>n;
    string s;cin>>s;

    rep(i,s.size()){
        if(s[i]=='1') s[i]='0';
        else if(s[i]=='2') s[i]='1';
        else if(s[i]=='3') s[i]='2';
    }
    int cnt[3]={};
    rep(i,s.size()){
        cnt[s[i]-'0']++;
    }
    int cntcnt=0;rep(i,3)if(cnt[i]>0) cntcnt++;
    if(cntcnt==1){
        cout<<0<<endl;
        return 0;
    }
    if(cnt[1]==0){
        vector<int> v(n);
        rep(i,n){
            if(s[i]=='0')   v[i]=0;
            else            v[i]=1;
        }
        if(f(v)) cout<<2<<endl;
        else     cout<<0<<endl;
        return 0;
    }

    vector<int> v(n);
    rep(i,n){
        if(s[i]=='1') v[i]=1;
        else          v[i]=0;
    }
    if(f(v))    cout<<1<<endl;
    else        cout<<0<<endl;
    return 0;
}


Measured memory_bytes: 13084
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
// #define mdfs
int N,M;

int main(void){
    // Your code here!
    cin >> N;
    int lt,lx,ly;
    lt = 0;lx = 0; ly = 0;
    for (int i = 0; i < N; i++) {
        int t,x,y;
        cin >> t >> x >> y;
        if (t - lt < abs(x-lx) + abs(y-ly)) {
            // cout << t << endl;
            cout << "No" << endl;
            return 0;
        }
        
        if ((t - lt) % 2 != (abs(x-lx) + abs(y-ly)) % 2) {
            cout << "No" << endl;
            return 0;
        }
        
        lt = t;
        lx = x;
        ly = y;
        
    }
    
    cout << "Yes" << endl;

}


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll A, B;
    cin >> A >> B;
    cout << A * B / __gcd(A, B) << '\n';
}

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


Measured memory_bytes: 256
//
//  main.cpp
//  CP
//
//  Created by Shiv Pavan Raj on 22/02/20.
//  Copyright © 2020 Shiv Pavan Raj. All rights reserved.
//

#include <bits/stdc++.h>

using namespace std;

#define SZ(x) ((int)(x).size())
using namespace std;
typedef pair<int,int> PII;
#define FF first
#define SS second
#define MP make_pair
#define PB push_back
#define REP(i,n) for (int i = 0; i < n; ++i)
#define FOR(i,a,b) for (int i = a; i <= b; ++i)
#define M 1000000007
#define MM 998244353
#define SZ(a) int((a).size())
#define all(v) (v).begin(), (v).end()
#define uni(v) sort(all(v)), (v).erase(unique(all(v)), (v).end())
#define mod 1000000007
//a and b are assumed to be taken modulo p
inline int add(int a, int b, int p = mod){ int c = a + b; if(c >= p) c -= p; return c; }
inline int sub(int a, int b, int p = mod){ int c = a - b; if(c < 0) c += p; return c; }
inline int mul(int a, int b, int p = mod){ return (a * 1ll * b) % p; }

using ll = long long;
using VI = vector<int>;
using PII = pair<int, int>;
using PLL = pair<ll, ll>;
using VLL = vector<ll>;
using ld = long double;

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

const int MX = 5e6+10;
const int MX2 = 1e6+5;

ll INF= 4 * (ll)1e18;


vector<string> v;
int main(int argc, const char * argv[]) {
    
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0); // insert code here...
    int H,W,K;
    cin >> H >> W >> K;
    for (int i = 0; i < H; ++i) {
        string s;
        cin >> s;
        v.push_back(s);
    }
    vector<vector<int> > sum(H+2,vector<int>(W + 2,0));
    for (int i = 1; i <= H; ++i) {
        for (int j = 1; j <= W; ++j) {
        
            sum[i][j] = (v[i - 1][j - 1] == '1'?1:0) + sum[i][j - 1] + sum[i - 1][j] - sum[i - 1][j - 1];
        }
    }
    int ans = H * W + 100;
    
    for (int i = 0; i <(1<<H); ++i) {
        vector<int> cuts;
        int noOfCuts = 0;
        cuts.push_back(0);
        for (int j = 0; j < H; ++j) {
            if (i & (1 << j)) {
                cuts.push_back(j + 1);
            }
        }
        noOfCuts = SZ(cuts) - 1;
        cuts.push_back(H);
        int prevCut = 0;
        bool canCutHere = false;
        for (int j = 1; j <= W; ++j) {
            canCutHere = true;
            for (int k = 1; k < SZ(cuts); ++k) {
                int diff = sum[cuts[k]][j] - sum[cuts[k - 1]][j] - (sum[cuts[k]][prevCut] - sum[cuts[k - 1]][prevCut]);
                if (diff > K) {
                    canCutHere = false;
                    break;
                }
            }
            if (!canCutHere) {
                noOfCuts += 1;
                if (prevCut == j - 1) {
                    break;
                }
                prevCut = j - 1;
                j = j - 1;
            }
        }
//        if (prevCut == 0 && canCutHere) {
//            ans = 0;
//        }
        if (canCutHere)
            ans = min(ans,noOfCuts);
    }
    cout << ans <<endl;
    return 0;
    
}







Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
using namespace std;

typedef long long ll;

ll a[5003];
bool seg[10003];


int main() {
	int n, k; cin >> n >> k;
	for (int i = 1; i <= n; ++i) cin >> a[i];
	sort(a + 1, a + n + 1);
	for (int i = n; i >= 1; --i) {
		if (a[i] >= k) {
			--n;
		}
	}
	int lo = 0, hi = n + 1;
	while (hi - lo > 1) {
		int mid = lo + (hi - lo) / 2;
		for (int i = 0; i < 10003; ++i) seg[i] = false;
		seg[0] = true;
		for (int i = 1; i <= n; ++i) {
			if (i == mid) continue;
			for (int j = 10002 - a[i]; j >= 0; --j) {
				if (!seg[j]) continue;
				seg[j + a[i]] = true;
			}
		}
		bool flag = false;
		for (int i = k - a[mid]; i < k; ++i) {
			flag |= seg[i];
		}
		if (flag) hi = mid;
		else lo = mid;
	}
	cout << lo << endl;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define In_The_Name_Of_Allah_The_Merciful ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define Alhamdulillah return 0;
#define debug(n) cerr << "[" << #n << " = " << n << "]" << endl 

void Suhaib_Sawalha (){

    int n , m;
    cin >> n >> m;
    int deg[n] = {};
    while (m--){
        int a , b;
        cin >> a >> b;
        deg[a-1]++;
        deg[b-1]++;
    }
    for (int i = 0 ; i < n ; ++i)
        cout << deg[i] << "\n";
}

int main(){
                                In_The_Name_Of_Allah_The_Merciful   /* بسم الله الرحمن الرحيم  */
#ifndef ONLINE_JUDGE
    freopen("SuhaibSawalha1.txt","r",stdin);
#endif
//int _;for(cin>>_;_;--_,cout<<'\n')
        Suhaib_Sawalha();
                                         Alhamdulillah                    /* الحمد لله */
}

Measured memory_bytes: 3616
from itertools import permutations, product
from copy import deepcopy
k = int(input())
rc = [tuple(map(int, input().split())) for _ in range(k)]

for i in permutations(range(8), 8):#product(rx, ry):
    se = set(rc)
    bitmap = [0]*8
    #for i in bitmap: print(f'{i:08b}')
    for y,x in enumerate(i):
        bitmap[y] = 128>>x

    flag = False
    for i in se:
        if not (bitmap[i[0]] & 128>>i[1]):
            flag = True
            break
    if flag:
        continue
    left,down,right = 0,0,0
    for i in bitmap:
        if (left | down | right) & i:
            break
        left = (left | i)<<1
        down = down | i
        right = (right | i)>>1
    else:
        for i in bitmap:
            print('{:08b}'.format(i).replace('0','.').replace('1','Q'))



Measured memory_bytes: 6312
#include <iostream>
#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <algorithm>
#define mp make_pair

using namespace std;

typedef long long LL;
typedef pair<int, int> pii;
typedef pair<int, LL> pil;

const int MAXN = 1e5 + 7;

template<typename T> inline T read() {
	T res = 0, flag = 1; char in = getchar();
	while(!isdigit(in)) { if(in == '-') flag = -1; in = getchar(); }
	while(isdigit(in)) { res = (res << 1) + (res << 3) + in - '0'; in = getchar(); }
	return res * flag;
}

template<typename T> inline void chkmax(T &a, T b) { if(a < b) a = b; }
template<typename T> inline void chkmin(T &a, T b) { if(a > b) a = b; }

int dp[3][MAXN];
int w[3], n;

inline int Max(int a, int b, int c) { return max(a, max(b, c)); }

inline void sovle() {
	n = read<int>();
	for(int i = 1; i <= n; ++i ) {
		for(int j = 0; j < 3; ++j) w[j] = read<int>();
		for(int j = 0; j < 3; ++j)
			for(int k = 0; k < 3; ++k) {
				if(j == k) continue;
				chkmax(dp[j][i], dp[k][i - 1] + w[j]);
			}
	}
	printf("%d\n", Max(dp[0][n], dp[1][n], dp[2][n]));
}

int main() {
	sovle();

	return 0;
}



Measured memory_bytes: 1408
N=int(input())
c=list(input())

W_cnt=c.count("W")
R_cnt=c.count("R")

wcnt=0
rcnt=0
for n in range(R_cnt):
    if c[n]=="W":
        wcnt+=1
for n in range(R_cnt+1,N):
    if c[n]=="R":
        rcnt+=1
print(max(wcnt,rcnt))


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

int main(){
  int a,b;
  double aa,bb;
  
  cin >> a >> b;
  
  aa=(double){a};
  bb=(double){b};
  
  cout << a/b << ' ' << a%b << ' ';
  printf("%lf\n",aa/bb);
  
  return 0;
}

Measured memory_bytes: 3232
#include <stdio.h>
main(){
  int h,m,s,A,t,w;
  scanf("%d",&A);

  h=A/3600;
  t=A%3600;
  m=t/60;
  s=t%60;

  printf("%d:%d:%d\n",h,m,s);

  return 0;
}  

Measured memory_bytes: 592
#include <bits/stdc++.h>
using namespace std;
#define SELECTER(_1, _2, _3, SELECT, ...) SELECT
#define REP1(i, n) for(int i=0; (i)<(n); (i)++)
#define REP2(i, a, b) for(int i=(a); (i)<(b); (i)++)
#define REP(...) SELECTER(__VA_ARGS__, REP2, REP1,) (__VA_ARGS__)
#define MOD 1'000'000'007

template <class T> ostream& operator<<(ostream& os, const vector<T>& v){ os << "{"; for(size_t i=0; i<v.size(); i++) os << v[i] << (i+1==v.size() ? "" : ", "); os << "}"; return os; }
template <class T, class U> ostream& operator<<(ostream& os, const pair<T, U>& p){ return os << "{" << p.first << ", " << p.second << "}"; }

using ll = long long;
using P = pair<int, int>;
const int dy[4] = {1, -1, 0, 0};
const int dx[4] = {0, 0, 1, -1};

int main(){
    int N, M;
    cin >> N >> M;
    vector<tuple<ll, ll, ll>> ABC(N), DEF(M);
    map<ll, int> mx, my;
    mx[0] = 0;
    my[0] = 0;
    REP(i, N){
        ll A, B, C;
        cin >> A >> B >> C;
        ABC[i] = make_tuple(A, B, C);
        mx[A] = 0;
        mx[B] = 0;
        my[C] = 0;
    }
    REP(i, M){
        ll D, E, F;
        cin >> D >> E >> F;
        DEF[i] = make_tuple(D, E, F);
        mx[D] = 0;
        my[E] = 0;
        my[F] = 0;
    }
    vector<ll> vx, vy;
    for(auto &z : mx){
        z.second = vx.size();
        vx.push_back(z.first);
    }
    for(auto &z : my){
        z.second = vy.size();
        vy.push_back(z.first);
    }
    int H = 2*vy.size();
    int W = 2*vx.size();
    vector<vector<int>> v(H, vector<int>(W));
    for(auto abc : ABC){
        ll A, B, C;
        tie(A, B, C) = abc;
        int x0 = mx[A];
        int x1 = mx[B];
        int y = my[C];
        for(int x=2*x0; x<=2*x1; x++) v[2*y][x] = 2;
    }
    for(auto def : DEF){
        ll D, E, F;
        tie(D, E, F) = def;
        int x = mx[D];
        int y0 = my[E];
        int y1 = my[F];
        for(int y=2*y0; y<=2*y1; y++) v[y][2*x] = 2;
    }
    v[2*my[0]+1][2*mx[0]+1] = 1;
    queue<P> que;
    que.emplace(2*my[0]+1, 2*mx[0]+1);
    while(!que.empty()){
        auto yx = que.front(); que.pop();
        int y = yx.first, x = yx.second;
        for(int i=0; i<4; i++){
            int y2 = y + dy[i];
            int x2 = x + dx[i];
            if(x2 < 0 || x2 >= W) continue;
            if(y2 < 0 || y2 >= H) continue;
            if(v[y2][x2] == 1) continue;
            if(v[y2][x2] == 2) continue;
            v[y2][x2] = 1;
            que.emplace(y2, x2);
        }
    }
    //REP(i, H){
    //    REP(j, W){
    //        if(v[i][j] == 2) cerr << "#";
    //        else if(v[i][j] == 0) cerr << ".";
    //        else cerr << "*";
    //    }
    //    cerr << endl;
    //}
    REP(y, H)
        if(v[y][0] == 1 || v[y][W-1] == 1){
            cout << "INF" << endl;
            return 0;
        }
    REP(x, W)
        if(v[0][x] == 1 || v[H-1][x] == 1){
            cout << "INF" << endl;
            return 0;
        }
    long long ans = 0;
    REP(i, vy.size()) REP(j, vx.size())
        if(v[2*i+1][2*j+1]==1){
            ans += (vy[i+1]-vy[i]) * (vx[j+1]-vx[j]);
        }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 144644
const main = arg => {

    const input = arg.trim().split("\n");
    const n = parseInt(input[0]);
    ds = input[1].trim().split(" ").map(e => parseInt(e));

    let sum = 0;
    for (let i = 0; i < n; i++) {
        for (let j = i + 1; j < n; j++) {
            sum += ds[i] * ds[j];
        }
    }
    console.log(sum);

}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 29440
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int r=sc.nextInt();
        int d=sc.nextInt();
        int x=sc.nextInt();
        for(int i=0;i<10;i++){
            System.out.println(x=r*x-d);
        }
                
    }
}


Measured memory_bytes: 21716
#include <iostream>
#include <vector>
#include <cstdint>

using namespace std;

static void inputArray(uint32_t A[], int num) {
  for (int i = 0; i < num; i++) {
    cin >> A[i]; 
  }
}

static void printArray(uint32_t A[], int num) {
  for (int i = 0; i < num; i++) {
    cout << (i != 0 ? " " : "") << A[i];
  }
  cout << endl; 
}

static int compared = 0;

static vector<uint32_t> L(250000);
static vector<uint32_t> R(250000);

static inline void merge(uint32_t A[], uint32_t left, uint32_t mid, uint32_t right) {
  uint32_t n1 = mid - left;
  uint32_t n2 = right - mid;

  for (int i = 0; i < n1; i++) {
    L[i] = A[left + i];
  }

  for (int i = 0; i < n2; i++) {
    R[i] = A[mid + i];
  }

  L[n1] = R[n2] = UINT32_MAX;

  for (uint32_t i = 0, j = 0, k = left; k < right; k++) {
    compared++;
    if (L[i] <= R[j]) {
      A[k] = L[i];
      i++;
    } else {
      A[k] = R[j];
      j++;
    }
  } 
}

static inline void mergeSort(uint32_t A[], uint32_t left, uint32_t right) {
  if (left + 1 < right) {
    uint32_t mid = (left + right) / 2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  } 
}

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

  vector<uint32_t> A(n);
  inputArray(&A[0], n);
  
  mergeSort(&A[0], 0, n);
  
  printArray(&A[0], n);
  
  cout << compared << endl;
  
  return 0;
}



Measured memory_bytes: 6800
#include <bits/stdc++.h>
using namespace std;
typedef long long int LL;

template <typename T>
ostream& operator <<(ostream& out, const vector<T>& vec) {
    out << "[";
    for (int x : vec) out << x << ", ";
    out << "]";
    return out;
}

#if DEBUG && !ONLINE_JUDGE
    ifstream input_from_file("input.txt");
    #define cin input_from_file
    #define dbg_var(x) clog << #x << ": " << x << endl;
#endif

int dp[400][400][400];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string S;
    int N, K;
    cin >> S >> K;
    N = S.size();
    for(int l = 0; l < N; ++l) {
        for(int k = 0; k <= K; ++k) {
            dp[l][l + 1][k] = 1;
        }
    }
    for(int len = 2; len <= N; ++len) {
        for(int l = 0; l + len <= N; ++l) {
            int r = l + len;
            int i = -1;
            for(int j = l + 1; j < r; ++j) {
                if(S[j] == S[l]) {
                    i = j;
                }
            }
            for(int k = 0; k <= K; ++k) {
                dp[l][r][k] = dp[l + 1][r][k];
                if(l + 1 <= i) {
                    dp[l][r][k] = max(dp[l][r][k], 2 + dp[l + 1][i][k]);
                }
                if(k > 0) {
                    dp[l][r][k] = max(dp[l][r][k], 2 + dp[l + 1][r - 1][k - 1]);
                }
            }
        }
    }
    cout << dp[0][N][K] << '\n';
}


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

#define ll         long long int
#define pb         push_back
#define mk         make_pair
#define vec        vector<int>
#define iter       vector<int>:: iterator
#define f(n)       for(int i=0 ; i<n ; i++)
#define sz         size()
#define sort(v)    sort(v.begin() , v.end())

#define fast       ios_base::sync_with_stdio(false);cin.tie(NULL)

using namespace std;

int main(){

       fast;
       int n;
       cin>>n;

       int a[n] ,kt=0;
       f(n)cin>>a[i];

       for(int i=1 ; i<n-1 ; i++){
        if(((a[i]>=a[i-1]) && (a[i] <= a[i+1])) || ((a[i]<=a[i-1]) && (a[i] >= a[i+1]))){
            ++kt;
        }
       }
       cout<<kt<<endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int A, B, K;
    vector<int> ans;
    cin >> A >> B >> K;
    for (int i = 100; i >= 1; i--)
    {
        if(A % i == 0 && B % i == 0)
        {
            ans.push_back(i);
        }
    }
    cout << ans[K-1] << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(v) v.begin(),v.end()

using namespace std;
typedef long long ll;


int N,M;
vector<vector<int> > V;
vector<int> perm;



int main(){
    
    cin >> N >> M;
    V.assign(N+1, vector<int>(N+1, 0));
    rep(i,M){
        int a,b;
        cin >> a >> b;
        V[a][b] = 1;
        V[b][a] = 1;
    }
    rep(i,N-1) perm.push_back(i+2);
    
    int ans = 0;
    
    do{
        bool aa = true;
        if (V[1][perm[0]] == 1) {
            rep(i,N-2){
                
                if (V[perm[i]][perm[i+1]] == 0) {
                    aa = false;
                    break;
                }

            }
            
            if (aa) {
                ans += 1;
            }
        }
        
        
        
        
    }while (next_permutation(all(perm)));
    
    cout << ans << endl;
    
    return 0;

}


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

int main() {
    int n,temp;
    vector<int> a;
    cin>>n;
    rep(i,n) {
        cin>>temp;
        a.push_back(temp);
    }
    double ans;
    for ( auto &&p : a) ans+=1/(double)p;
    ans=1/ans;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include<algorithm>
#include<string>
#include<stdio.h>
#include<map>
#include<math.h>
#include<queue>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int MOD = 1000000007;
const int mod = 1000000007;
const int INF = 1000000001;
const long long LINF = 1e18;
const int MAX = 510000;

int main() {
	string s;
	cin >> s;
	vector<bool> f(4);
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'N') { f.at(0) = 1; }
		if (s[i] == 'S') { f.at(1) = 1; }
		if (s[i] == 'W') { f.at(2) = 1; }
		if (s[i] == 'E') { f.at(3) = 1; }
	}
	if (f.at(0) == f.at(1) && f.at(2) == f.at(3))cout << "Yes" << endl;
	else {
		cout << "No" << endl;
	}



		return 0;
}

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

#define dump(a) (cerr << #a << " = " << (a) << endl)

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

double calc(int x, int r, double v, double e, double f) {
  if(x >= r) return 1.0 / (v - e * (x - r));
  return 1.0 / (v - f * (r - x));
}

int main(){
  cout.setf(ios::fixed);
  cout.precision(10);

  for(int n; cin >> n && n;) {
    vector<int> a(n + 1, 0);
    for(int i = 1; i <= n; ++i) {
      cin >> a[i];
    }

    double b;
    cin >> b;

    int r;
    double v, e, f;
    cin >> r >> v >> e >> f;

    vector<vector<double>> dp(n + 1, vector<double>(n + 1, INT_MAX));
    dp[0][0] = 0;

    for(int i = 0; i < n; ++i) {
      for(int j = 0; j <= i; ++j) {
	if(dp[i][j] == INT_MAX) continue;

	dp[i][i] = min(dp[i][i], dp[i][j] + b);

	double next_cost = 0.0;
	for(int x = a[i]; x < a[i + 1]; ++x) {
	  next_cost += calc(x - a[j], r, v, e, f);
	}

	dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + next_cost);
      }
    }

    double ans = INT_MAX;
    for(int i = 0; i <= n; ++i) {
      ans = min(ans, dp[n][i]);
    }

    cout << ans << endl;
  }

  return 0;
}

Measured memory_bytes: 1396
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <deque>
#include <queue>
#include <functional>
//#include <boost/multiprecision/cpp_int.hpp>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)
#define llrep(i, n) for(ll i = 0; i < n; ++i)
#define llREP(i, m, n) for(ll i = m; i < n; ++i)
#define llrrep(i,n) for(ll i = n; i >= 0; --i)
#define llRREP(i, m, n) for(ll i = n; i >= m; --i)

using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;
using pil = std::pair<int, long long>;
using pli = std::pair<long long, int>;
using plpii = std::pair<long long, std::pair<int, int>>;
using pdd = std::pair<double, double>;

const long long INF = 1000000000000000001;
const long long _MOD = 1000000007;
const long long MOD = 998244353;
const int ALPHABET = 27;
const double pi = 3.14159265358979;

using namespace std;
//namespace mp = boost::multiprecision;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n;
	cin >> n;
	int* a = new int[n];
	rep(i, n) cin >> a[i];

	int q;
	cin >> q;
	pll* query = new pll[q];
	rep(i, q) cin >> query[i].first >> query[i].second;

	map<ll, ll> m;
	rep(i, n) {
		m[a[i]] += 1;
	}
	ll sum = 0;
	for (auto ite = m.begin(); ite != m.end(); ++ite) {
		sum += (*ite).first * (*ite).second;
	}

	rep(i, q) {
		m[query[i].second] += m[query[i].first];
		sum -= query[i].first * m[query[i].first];
		sum += query[i].second * m[query[i].first];
		
		m.erase(query[i].first);

		cout << sum << "\n";
	}

	return 0;
}

Measured memory_bytes: 9568
i=0
while i < 300:
    h, w = map(int, input().split())
    
    if h == 0 and w == 0:
        break
    else:
        for a in range(w):
            print("#", end="")
        print()
        for b in range(h-2):
            print("#", end="")
            for c in range(w-2):
                print(".", end="")
            print("#")
        for d in range(w):
            print("#", end="")
        print()
        print()



Measured memory_bytes: 6996
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using P = pair<int, int>;
#define debug(var) cerr << "[" << #var << "] " << var << endl
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};


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


Measured memory_bytes: 3752
n = int(input())
a = sorted(list(map(int,input().split())))
cou = a.pop()
n1 = n-2
if n1%2==0:
  t = n1//2
  for i in range(t):
    q = a.pop()
    cou += q*2
else:
  t = n1//2
  for i in range(t):
    q = a.pop()
    cou += 2*q
  cou += a.pop()
print(cou)


Measured memory_bytes: 31504
#include <stdio.h>
int main(){
    
    int a,b,c;
    
    0 <= a,b,c <= 100;
    
    scanf("%d %d %d",&a,&b,&c);
    
    if (a < b && b < c){
        printf("Yes\n");
    }
    else {
        printf("No\n");
    }
    
    return 0;
}


Measured memory_bytes: 2036
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using static System.Math;
 
public class Hello{
    public static void Main(){
        string[] input = ReadLine().Split(' ');
        long n = long.Parse(input[0]);
        long m = long.Parse(input[1]);
        WriteLine(n+(m/2)); 

    }
}

Measured memory_bytes: 13140
#![allow(unused)]

use std::io::{Read, StdinLock};
use std::iter::{FromIterator, Iterator};
use std::str::{FromStr};
use std::string::String;

macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

pub fn read_bytes<T: FromIterator<char>>(s: &mut StdinLock) -> T {
    s.bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<T>()
}

pub fn reads(s: &mut StdinLock) -> String {
    read_bytes::<String>(s)
}

pub fn read<T: FromStr>(s: &mut StdinLock) -> T {
    reads(s).parse().ok().unwrap()
}

//==============================================================================
//
// Problem specific code
//
//==============================================================================

fn main() {
    let sin = std::io::stdin();
    let mut sin = sin.lock();

    let n: Vec<char> = read_bytes(&mut sin);

    println!("{}",
        if n[0] == '7' || n[1] == '7' || n[2] == '7' { "Yes" } else { "No" });
}

Measured memory_bytes: 2140
#include<stdio.h>
 
int main( void ) 
{
 
    int n;
    scanf( "%d", &n );
    
    int i, j;
    int num[10000]; 
    int cnt = n;
    for( i=0; i<n; i++ ) {
        scanf( "%d", &num[i] );
    }
    for( i=0; i<n; i++ ) {    
        if( 2 == num[i] ) { continue; }
        
        if( 0 != num[i]%2 ) {
            for( j=3; j*j<=num[i]; j+=2 ) {
                if( 0 == num[i]%j ) {
                    cnt--;
                    break;
                }
            }
        } else {
            cnt--;
        }
        
    }
     
    printf( "%d\n", cnt );
    
    return 0;
}

Measured memory_bytes: 632
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

int memo[2][2001][2001][2] = {};

int dfs(VI &a, VI &b, int &n, int x, int y, int t, bool bo=true) {
    if (memo[t][x][y][bo] > -1) return memo[t][x][y][bo];
    if (x == n || y == n) return memo[t][x][y][bo] = abs(a[x] - b[y]);
    if (t == 0) {
        if (!bo) return memo[t][x][y][bo] = dfs(a,b,n,max(x,y)+1,y,0);
        return memo[t][x][y][bo] = max(dfs(a,b,n,max(x,y)+1,y,0), dfs(a,b,n,x,max(x,y)+1,1));
    } else {
        if (!bo) return memo[t][x][y][bo] = dfs(a,b,n,max(x,y)+1,y,1);
        return memo[t][x][y][bo] = min(dfs(a,b,n,max(x,y)+1,y,0), dfs(a,b,n,x,max(x,y)+1,1));
    }
}

void solve() {
    int n,z,w;
    cin >> n >> z >> w;
    VI a(n+1), b(n+1);
    int in;
    a[0] = z; b[0] = w;
    REP(i,0,n) {
        cin >> in;
        a[i+1] = b[i+1] = in;
    }
    REP(i,0,2) REP(j,0,n+1) REP(k,0,n+1) REP(l,0,2) memo[i][j][k][l] = -1;
    cout << dfs(a,b,n,0,0,0,false) << endl;
}

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


Measured memory_bytes: 62976
#include <bits/stdc++.h>
using namespace std;
int main () {
  long N;
  cin >> N;
  vector<long> data(N);
  for(int i = 0; i < N; i++){
    cin >> data.at(i);
  }
  sort(data.begin(), data.end());
  reverse(data.begin(), data.end());
  long ans = data.at(0), count = N - 2; 
  for(int i = 1; i < N; i++){
    if(count == 1){
      ans += data.at(i);
      break;
    } else if(count == 0)break;
     else {
       ans += data.at(i) * 2;
       count -= 2;
     }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 4824
s=input()

if len(s)==1:
    print(0)
else:
    cnt=0
    t=s[0]
    for i in range(len(s)-1):
        if t[i]!=s[i+1]:
            t+=s[i+1]
        else:
            cnt+=1
            if s[i+1]=="1":
                t+="0"
            else:
                t+="1"
    print(cnt)

Measured memory_bytes: 3188
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		char s[]=sc.next().toCharArray();

		int score=0;
		int best=0;
		for(int i=1;i<N;i++){
			if(s[i]=='E')score++;
		}
		best=score;
		
		for(int i=1;i<N;i++){
			if(s[i-1]=='W')score++;
			if(s[i]=='E')score--;
			if(best>score) best=score;
		}

		System.out.println(best);
	}

	public static int gcd(int a, int b) {
		return a%b==0 ? b : gcd(b,a%b);
	}
}


Measured memory_bytes: 29076
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9+7;
template<int mod> struct ModInt {
    int x;
    ModInt() : x(0) {}
    ModInt(long long y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
    ModInt &operator+=(const ModInt &p) { if((x += p.x) >= mod) x -= mod; return *this; }
    ModInt &operator-=(const ModInt &p) { if((x += mod-p.x) >= mod) x -= mod; return *this; }
    ModInt &operator*=(const ModInt &p) { x = (int)(1LL*x*p.x%mod); return *this; }
    ModInt &operator/=(const ModInt &p) { *this *= p.inverse(); return *this; }
    ModInt operator-() const { return ModInt(-x); }
    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
    bool operator==(const ModInt &p) const { return x == p.x; }
    bool operator!=(const ModInt &p) const { return x != p.x; }
    ModInt inverse() const{
        int a = x, b = mod, u = 1, v = 0, t;
        while(b > 0) { t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); }
        return ModInt(u);
    }
    ModInt pow(int e){
        long long a = 1, p = x;
        while(e > 0) {
            if(e%2 == 0) {p = (p*p) % mod; e /= 2;}
            else {a = (a*p) % mod; e--;}
        }
        return ModInt(a);
    }
    friend ostream &operator<<(ostream &os, const ModInt<mod> &p) {
        return os << p.x;
    }
    friend istream &operator>>(istream &is, ModInt<mod> &a) {
        long long x;
        is >> x;
        a = ModInt<mod>(x);
        return (is);
    }
};

ModInt<MOD> com(int n, int r) {
    ModInt<MOD> ret = 1;
    for (int i = n; i > n-r; i--) ret *= i;
    for (int i = 2; i <= r; i++) ret /= i;
    return ret;
}


ModInt<MOD> mpow(long long x, long long n) {
    if (n == 0) return 1;
    if (n % 2 == 1) {
        ModInt<MOD> t = x;
        return t * mpow(x, n-1);
    }
    ModInt<MOD> t = mpow(x, n / 2);
    return (t * t);
}

int main() {
    int n, a, b;
    cin >> n >> a >> b;
    ModInt<MOD> ans = mpow(2, n) - 1;
    ans -= (com(n, a) + com(n, b));
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
#include <cstdio>
#include <set>

int main()
{
  int n;
  scanf("%d", &n);
  int a[100000];
  int ans = 0;
  for (int i = 0; i < n; ++i)
  {
    scanf("%d", a + i);
    --a[i];
    if (a[i] < i && a[a[i]] == i) ++ans;
  }
  printf("%d\n", ans);
  return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF  UnionFind 
#define Pint pair<int,int>
#define keta(a)  fixed << setprecision(a)
constexpr auto INF = 100000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで！
// lower_boundは二分探索
struct edge { int to, cost; };
long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

// mod. m での a の逆元 a^{-1} を計算するよ！
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}


//aCbをmod.mで割った余りを求める
ll int c(ll int a, ll int b, ll int m) {
	ll int ans = 1;
	for (ll int i = 0; i < b; i++) {
		ans *= a - i;
		ans %= m;
	}
	for (ll int i = 1; i <= b; i++) {
		ans *= modinv(i, m);
		ans %= m;
	}
	return ans;
}

//sは初めの点、vは頂点size、dは最短距離を求める(初期化はINF),Gは有向グラフ
void dijkdtra(int s, int v, vector<int>& d, whei(edge)& G) {
	priority_queue<Pint, vector<Pint>, greater<Pint>> que;//firstが距離、secondが頂点
	d[s] = 0;//スタートの距離はもちろんzero
	que.push(Pint(0, s));
	while (!que.empty()) {
		Pint p = que.top();
		que.pop();
		int V = p.second;
		if (d[V] < p.first)continue;
		for (int i = 0; i < G[V].size(); i++) {
			edge e = G[V][i];
			if (d[e.to] > d[V] + e.cost) {
				d[e.to] = d[V] + e.cost;
				que.push(Pint(d[e.to], e.to));
			}
		}
	}
}

llint binary_search(vector<int>&s,llint a) {
	llint l = -1;
	llint r = (int)s.size();
	while (r - l > 1) {
		llint mid = l + (r - l) / 2;

		if (s[mid]>=a) r = mid;
		else l = mid;
	}
	return r;
}


int main() {
	llint n;
	cin >> n;
	hei(int) a(n), b(n), c(n);
	rep(i, 0, n)cin >> a[i];
	rep(i, 0, n)cin >> b[i];
	rep(i, 0, n)cin >> c[i];
	sort(a.begin(), a.end());
	sort(b.begin(), b.end());
	sort(c.begin(), c.end());
	llint ans = 0;
	int r = 0, l = 0;
	rep(i, 0, n) {
		while (l < n && a[l] < b[i])l++;
		while (r <n && c[r] <= b[i])r++;
		ans += l * (n-r);
	}
	cout << ans << endl;
	return 0;
}

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

bool isPrime(int x)
{
    if(x== 2)
        return true;
    if(x == 1 || x%2 == 0)
        return false;
    for(int i = 3;i*i <= x;i+=2)
        if(x%i==0)
            return false;
    return true;
}
int main()
{
    int x;
    cin >> x;
    while(!isPrime(x))
        x++;
    cout << x;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //ai>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //ai>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define REV(x) (reverse(x.begin(),x.end())) //reverse
#define TO(x,t,f) ((x)?(t):(f))
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define FILV(x,a) fill(x.begin(),x.end(),a)
#define FILA(ar,N,a) fill(ar,ar+N,a)
#define NEXTP(x) next_permutation(x.begin(),x.end())
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;else return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define pb push_back
#define pri(aa) cout<<(aa)<<endl
#define mp(x,y) make_pair(x,y)
#define fi first
#define se second
const ll INF=1e9+7;
const ll N = 1007;





int main(){
	while(1){
		ll m,nmin,nmax,ans;
		vector<ll> p;
		cin>>m>>nmin>>nmax;
		if(m==0&&nmin==0&&nmax==0)break;
		p.resize(m);
		FOR(i,0,m){
			cin>>p[i];
		}
		SORT(p);
		ll g=p[m-nmin] - p[m-nmin-1];
		ans = nmin;
		FOR(i,nmin,nmax+1){
			if(g<=p[m-i] - p[m-i-1]){
				ans = i;
				g = p[m-i] - p[m-i-1];
			}
		}
		cout<<ans<<endl;
	}
}


Measured memory_bytes: 3136
/*
मनस्वी म्रियते कामं कार्पण्यं न तु गच्छति ।
अपि निर्वाणमायाति नानलो याति शीतताम् ॥
*/

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds;
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ll long long int
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define v2i vector<vector<int>>
#define v2l vector<vector<ll>>
#define ppi pair<int,int>
#define ppl pair<ll,ll>
#define vpi vector<ppi>
#define vpl vector<ppl>
#define all(x) x.begin(),x.end()
#define ii int,int 
#define ff first    
#define ss second
#define forn(i,a,b) for(int i=a;i<b;i++)
#define forr(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,m) for(auto i : m)
#define p2d(v) for(auto a:v){for(auto b:a)cout<<b<<" ";cout<<endl;}
#define p1d(v) for(auto a:v)cout<<a<<" ";cout<<endl;
#define ppd(v) for(auto a:v)cout<<a.ff<<" "<<a.ss<<endl;
#define imx INT_MAX
#define imn INT_MIN
#define inf 9000000000000000000
#define minf -inf
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define sze size()
#define rvs reverse 
#define itr iterator 
#define pre cout<<fixed<<setprecision(10);
#define umap unordered_map
#define uset unordered_set
#define pi 3.141592653589793
#define MAXN 100005
#define test1(x) cout << #x " = " << x << endl;
#define test2(x,y) cout << #x " = " << x << " " << #y " = " << y << endl;
#define test3(x,y,z) cout << #x " = " << x << " " << #y " = " << y << " " << #z " = " << z << endl;
#define test4(w,x,y,z) cout << #w " = " << w << " " << #x " = " << x << " " << #y " = " << y << " " << #z " = " << z << endl;
const ll infinity = 9e18;

/*
#define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define MODM(a,b,md) ((a%md)*(b%md))%md
#define MODA(a,b,md) ((a%md)+(b%md))%md
#define ull unsigned long long int
*/

/*
bool compare(int a,int b) {return a > b;}
bool compare1(ppi a,ppi b) {return a.ff > b.ff;}
bool compare2(ppi a,ppi b) {return a.ss < b.ss;}
ll Npower(ll a,ll b) {ll product = 1; while(b){if(b&1){product = product*a;}a = a*a;b = b>>1;} return product;}
ll power(ll a,ll b,ll md) {ll product = 1; while(b){if(b&1){product = MODM(product,a,md);}a = MODM(a,a,md);b = b>>1;} return product%md;}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}
ll GCD(ll a,ll b) {return b==0 ? a:GCD(b,a%b);}
ll LCM(ll a,ll b) {return (a/GCD(a,b))*b; }
*/


int main()
{
    fast

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

        
    char ch;
    cin>>ch;

    if(ch >= 'a')
    {
        cout<<'a';
    }
    else cout<<'A';
        
        












    return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

typedef long long ll;
const ll max_val = (ll) 1e5 + 5;
const ll INF = (ll) 1e15 + 5;

int main() {
	int n, w;
	cin>>n>>w;
	
	vector<vector<ll> > dp(n, vector<ll>(max_val, INF));
	dp[0][0] = 0;
	
	for(int i=0; i<n; i++) {
		ll weight, value;
		cin>>weight>>value;
		
		if(i==0) dp[i][value] = weight;
		else {
			dp[i] = dp[i-1];
			for(int j=max_val-1; j>=0; j--) {
				if(dp[i][j] != INF) {
					dp[i][j+value] = min(dp[i][j+value], dp[i][j] + weight);
				}
			}
		}
	}
	for(int i=max_val-1; i>=0; i--) {
		if(dp[n-1][i] <= w) {
			cout<<i<<endl;
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 79488