akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector> 
#include<utility>
using namespace std;
#define INF 0x3f3f3f3f
#define ft first
#define sd second
#define MAX 1000*2+16 
vector<int> arr[MAX];
int x[MAX],vis[MAX];
int dist[105][105];
int N,M,L;
void floyd()
{
	int k,i,j;
	for(i=0;i<N;i++)
		dist[i][i]=0;
	for(k=0;k<N;k++)
		for(i=0;i<N;i++)
			for(j=0;j<N;j++)
				dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j]);				
}

int dfs(int v)
{
	vis[v]=1;
	for(int i=0;i<arr[v].size();i++)
	{
		int m=arr[v][i];
		int w=x[m];
		if(w<0||(!vis[w]&&dfs(w)))
		{
			x[v]=m;
			x[m]=v;
			return 1;
		}	
	}
	return 0;
}
int V;
int solve()
{
	int ans=0;
	memset(x,-1,sizeof(x));
	for(int i=0;i<V;i++)
	{
		if(x[i]<0)
		{
			memset(vis,0,sizeof(vis));
			ans+=dfs(i);
		}
	}
	return ans;
}
void add(int u,int v)
{
	arr[u].push_back(v);
	arr[v].push_back(u);
}
int p[1050],t[1050]; 
int main()
{
	while(scanf("%d%d%d",&N,&M,&L)!=EOF&&N)
	{
		V=L*2;
		memset(dist,INF,sizeof(dist));
		int i,m1,m2,m3;
		for(i=0;i<M;i++)
		{
			scanf("%d%d%d",&m1,&m2,&m3);
			dist[m1][m2]=dist[m2][m1]=m3;
		}
		floyd();
		for(i=0;i<L;i++)
		{
			scanf("%d%d",&m1,&m2);
			p[i]=m1;
			t[i]=m2;
		}
		for(i=0;i<L;i++)
		{
			for(int j=0;j<L;j++)
			{
				if(i!=j&&dist[p[i]][p[j]]+t[i]<=t[j])
				{
					add(i,L+j);
				}
			}
		}
		printf("%d\n",L-solve());
		for(i=0;i<V;i++)arr[i].clear();
	}
	return 0;
}


Measured memory_bytes: 11080
#include<bits/stdc++.h>
#define endl "\n"
#define ll long long int
#define MOD 1000000007
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define nrep(i,a,b) for(ll i=a;i>=b;i--)

using namespace std;
int main()
{
	fast;
	string s;
	cin>>s;
	bool flag=true;
	rep(i,0,(ll)s.length())
	{
		if(i&1)
		{
			if(s[i]=='R')
			{
				flag=false;
				break;
			}
		}
		else
		{
			if(s[i]=='L')
			{
				flag=false;
				break;
			}
		}
	}
	if(flag)
	{
		cout<<"Yes\n";
	}
	else
	{
		cout<<"No\n";
	}
}

Measured memory_bytes: 256
#include <bits/extc++.h>
using namespace std;
using i64 = int64_t;
#define mod 1000000007
i64 power(i64 a, i64 b) {
  i64 ret{1};
  while (b) {
    if (b & 1) ret *= a, ret %= mod;
    a *= a;
    a %= mod;
    b /= 2;
  }
  return ret;
}
main() {
  int n;
  cin >> n;

  i64 dp[2020] = {};
  dp[0] = 1;
  for (int i = 0; i <= n; i++) {
    for (int j = 3; j + i <= n; j++) {
      (dp[i + j] += dp[i]) %= mod;
    }
  }
  cout << dp[n];
}


Measured memory_bytes: 3620
#include <stdio.h>
int main(void){
  int h,w,i,j;
  while(scanf("%d %d",&h,&w),h+w){
    for(i=0;i<w;i++)
      printf("#");
    printf("\n");
    for(i=0;i<h-2;i++){
      printf("#");
      for(j=0;j<w-2;j++)
        printf(".");
      printf("#");
      printf("\n");
    }
    for(i=0;i<w;i++)
      printf("#");
    printf("\n\n");
  }
  return 0;
}

Measured memory_bytes: 588
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int a,b,c,d,e,f,g,h,i;
int main()
{
	cin>>a>>b>>e;
	c=3*e-a-b;
	h=2*e-b;
	f=2*a-h;
	i=3*e-c-f;
	d=2*e-f;
	g=3*e-h-i;
	printf("%d %d %d\n%d %d %d\n%d %d %d",a,b,c,d,e,f,g,h,i);
	return 0;
}

Measured memory_bytes: 256
n = int(input())


ans = []

def anscnt(x,y,z):
  if (x == y) & (y == z):
    return 1
  if (x == y) or (y == z) or (z == x):
    return 3
  return 6
  
def getval(x,y,z):
  return (x + y + z) ** 2 - (x *y + y*z + z * x)
  
for k in range(1,n+1):
  anslist = []
  
  x,y,z = 1,1,1
  
  while True: #x
    while True: #y
      while True: #z
        val = getval(x,y,z)
        if val == k :
          anslist.append( anscnt(x,y,z) )
          break
        elif val > k:
          break
        z += 1
        
      y += 1
      z = y
      if getval(x,y,z) > k:
        break
    x += 1
    y = x
    z = x
    if getval(x,y,z) > k:
      break
  ans.append( sum(anslist) )
  #print(anslist)
_ = [print(i) for i in ans ]
          
      
      

Measured memory_bytes: 70172
#include<stdio.h>
int main()
{
    char s1[100];
    char s2[100];
    char s3[100];

    scanf("%s %s %s", s1, s2, s3);

    printf("%c%c%c\n", s1[0], s2[0], s3[0]);
    
    return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<vector<int>> dice(n,vector<int>(2));
  rep(i,n){
    cin >> dice[i][0] >> dice[i][1];
  }
  
  rep(i,n-2){
    int cnt=0;
    rep(j,3){
      if(dice[i+j][0] == dice[i+j][1]){
        cnt++;
      }
    }
    if(cnt == 3){
      cout << "Yes" << endl;
      return(0);
    }
  }
  
  cout << "No" << endl;
  return(0);
}

Measured memory_bytes: 3628
N,M= map(int,input().split())
dptaples = []
for i in range(N):
    An,Bn = map(int,input().split())
    dptaples.append((An,Bn))
dptaples.sort()
maxnum = 0
maxvalue = 0
for key,value in dptaples:
    if M>value+maxnum:
        maxvalue+=key*value
        maxnum += value
    else:
        maxvalue+=((M-maxnum)*key)
        break
print(maxvalue)

Measured memory_bytes: 16896
#include<iostream>
#include<algorithm>

using namespace std;

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

    long long x,y;
    cin>>x>>y;

    if(x+y<=1)
        cout<<"Brown\n";
    else if(abs(x-y)<=1)
        cout<<"Brown\n";
    else
        cout<<"Alice\n";
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fst first
#define snd second
#define all(v) begin(v), end(v)
#define debug(x) cerr<< #x <<": "<<x<<endl
#define debug2(x,y) cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<endl

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;
template<class T> using vv=vector<vector< T > >;

int main() {
  vi a(3);
  rep(i, 3) {
    scanf("%d", &a[i]);
  }
  vvi ans(3, vi(3));
  ans[0][0] = a[0];
  ans[0][1] = a[1];
  ans[1][1] = a[2];
  int sum = a[2] * 3;
  ans[0][2] = sum - ans[0][0] - ans[0][1];
  ans[2][0] = sum - ans[0][2] - ans[1][1];
  ans[2][1] = sum - ans[0][1] - ans[1][1];
  ans[2][2] = sum - ans[2][0] - ans[2][1];
  ans[1][0] = sum - ans[0][0] - ans[2][0];
  ans[1][2] = sum - ans[1][0] - ans[1][1];
  rep (i, 3) {
    rep (j, 3) {
      printf("%d%c", ans[i][j], (j == 2) ? '\n' : ' ');
    }
  }
  return 0;
}


Measured memory_bytes: 504
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <cmath>
 
#define rep(i,n) for(int i = 0;i < (n);i++)
#define all(x) (x).begin(),(x).end()
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)

using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<pair<int, int> > vpi;
typedef vector<pair<ll, ll> > vpl;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, k;
  cin >> n >> k;
  printf("%lld\n", k*(ll)pow(k-1,n-1));
	return 0;
}


Measured memory_bytes: 512
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<string>
#define MOD 1000000007
typedef long long ll;
using namespace std;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    int n; cin >> n;
    map<int,int> mp;
    for(int i=2;i<=n;i++){
        int a; cin >> a;
        mp[a]++;
    }
    for(int i=1;i<=n;i++) cout << mp[i] << endl;
    return 0;
}

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

int main() {

    int n, x; cin >> n >> x;
    int sum = 0;
    int minM = 2147483647;
    for (int i = 0; i < n; i++) {
        int  m; cin >> m;
        sum += m;
        minM = min(minM, m);
    }

    cout << n + (x - sum) / minM << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define SPEED ios_base::sync_with_stdio(false); cin.tie(NULL);
#define FOR(i, a, b) for (ll i = a; i < b; ++i)
#define RFOR(i, b, a) for (ll i = b; i >= a; --i)
#define ALL(x) x.begin(), x.end()
#define DEBUG(args...) { string _s = #args; replace(ALL(_s), ' ', '\0');\
replace(ALL(_s), ',', ' ');\
stringstream _ss(_s); istream_iterator<string> _it(_ss); _debug(_it, args);}
#define endl "\n"
#define F first
#define S second
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)

using namespace std;
using namespace __gnu_pbds;

template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

void _debug(istream_iterator<string>) {}
template<typename T, typename... Args>
void _debug(istream_iterator<string> it, T first, Args... args) {
    cerr << ">> " << *it << " : " << first << endl; _debug(++it, args...);
}
template <typename T1, typename T2>
inline ostream& operator << (ostream& out, const pair<T1, T2>& p) {
    return out << "(" << p.F << ", " << p.S << ")";
}
template<typename T>
inline ostream& operator << (ostream& out, const vector<T>& v) {
    if (v.empty()) return out << "[]";
    else { out << '['; for (auto& e : v) { out << e << ", "; } return out << "\b\b]"; }
}
template<typename T>
inline ostream& operator << (ostream& out, const set<T>& s) {
    if (s.empty()) return out << "{}";
    else { out << '{'; for (auto& e : s) { out << e << ", "; } return out << "\b\b}"; }
}
template<typename T>
inline ostream& operator << (ostream& out, const unordered_set<T>& s) {
    return out << set<T>(ALL(s));
}
template<typename T1, typename T2>
inline ostream& operator << (ostream& out, const map<T1, T2>& m) {
    if (m.empty()) return out << "{}";
    out << '{'; for (auto& p : m) { out << p << ", "; } return out << "\b\b}";
}
template<typename T1, typename T2>
inline ostream& operator << (ostream& out, const unordered_map<T1, T2>& m) {
    return out << map<T1, T2>(ALL(m));
}
template<typename T>
inline ostream& operator << (ostream& out, const ordered_set<T>& s) {
    return out << set<T>(ALL(s));
}

typedef long long ll;
typedef long double ld;
typedef vector<long long> vll;
typedef pair<ll, ll> pll;
typedef vector<pair<ll, ll>> vpll;
typedef unordered_map<ll, ll> STll;
/************************************** MAIN PROGRAM ********************************************/

int main()
{
    //freopen("input.txt", "r", stdin);
    SPEED
    ld l;
    cin >> l;
    cout << fixed << setprecision(10);
    cout << (l * l * l) / 27;
}
/************************************** END OF PROGRAM ******************************************/
/** Stuff you should look for:
 * int overflow, array bounds, over-counting
 * special cases (n=1?), set/unordered_set TLE, multi-set/set error
 * do something instead of nothing and stay organized
 */


Measured memory_bytes: 256
#x,a,b=[int(i) for i in input().split()]

N=int(input())
a=[int(input()) for i in range(N)]
light=[0 for i in range(N)]
light[0]=1
push=0
botton=0

for k in range(N):

 light[botton]=0
 light[a[botton]-1]=1

 botton=a[botton]-1
 push=push+1
 if light[1]==1:
   print(push)
   break




if light[1]!=1:
  print(-1)


Measured memory_bytes: 7852
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (int)(m); i < (int)(n); ++i)


int main()
{
    int A, B, H, M;
    cin >> A >> B >> H >> M;

    double theta = 2. * M_PI * (H*60 + M)/(12*60);
    double phi = 2. * M_PI * M/60;
    cout << fixed << setprecision(11) << sqrt(A*A + B*B - 2*A*B*cos(theta-phi)) << endl;

    return 0;
}

Measured memory_bytes: 3704
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll zero = 0;
const ll INF = 10000000000000000; //10^16
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;


int main(void){
    ll N;
    cin >> N;
    vector<ll> a(N+1);
    for(ll i = 1; i <= N; i++){
        cin >> a.at(i);
    }
    
    vector<ll> R(N+1), L(N+1);
    for(ll i = 1; i <= N; i++){
        R.at(i) = i - a.at(i);
        L.at(i) = i + a.at(i);
    }
    
    map<ll, ll> test;
    ll ans = 0;
    for(ll i = 1; i <= N; i++){
        test[L.at(i)]++;
        
        ans += test[R.at(i)];
    }
    
    printf("%lld\n", ans);
    
    
}

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

using namespace std;

typedef long long ll;
typedef vector<int> pi;
typedef pair<int,int> vi;

#define F first
#define S second
#define PB push_back
#define MK make_pair
#define REP(i, a, b) for (int i=a; i < b; i++)


bool sort_by(vi c, vi d){
	return c.S < d.S;
}

int main() {
	int N, c=0;
	cin >> N;
	pi a(N), b(N);
	for(int &x:a) cin >> x;
	for(int &y:b) cin >> y;
	if( a > b) swap (a, b);
	while(a < b){
		++c;
		next_permutation(a.begin(), a.end());
	}
	cout << c;

}


Measured memory_bytes: 256
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

n = ni()
a = nl()
dp = [[0]*3 for _ in range(n+5)]
t = n%2
for i in range(n):
    dp[i][0] = dp[i-2][0] + a[i]
    dp[i][1] = max(dp[i-2][1], dp[i-3][0]) + a[i]
    if t:
        dp[i][2] = max(dp[i-2][2], dp[i-3][1], dp[i-4][0]) + a[i]
if t:
    print(max(dp[n-3][0], dp[n-2][1], dp[n-1][2]))
else:
    print(max(dp[n-2][0], dp[n-1][1]))

Measured memory_bytes: 66644
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#define ll long long
using namespace std;
const int maxn=1e5+10;
const int mod=1e9+7;
int a[maxn];
int vis[maxn];
int n;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        int x;scanf("%d",&x);
        vis[x]++;
    }
    if(n%2==0)
    {
        ll ans=1;
        for(int i=1;i<=n-1;i+=2)
        {
            if(vis[i]==2)
                ans=(ans%mod*2)%mod;
            else
            {
                printf("0\n");
                return 0;
            }
        }
        printf("%lld\n",ans);
    }
    else
    {
        ll ans=1;
        if(vis[0]!=1)
        {
            printf("0\n");
            return 0;
        }
        for(int i=2;i<=n-1;i+=2)
        {
            if(vis[i]==2)
                ans=(ans%mod*2)%mod;
            else
            {
                printf("0\n");
                return 0;
            }
        }
        printf("%lld\n",ans);
    }
}


Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;


int main(){
    int a,b;
    cin>>a>>b;
    if(a==1 ||a==3 ||a==5 ||a==7||a==8||a==10||a==12){
        a=1;
    }else if(a==4||a==6||a==9||a==10){
        a=2;
    }else if(a==2){
        a=3;
    }
    if(b==1 ||b==3 ||b==5 ||b==7||b==8||b==10||b==12){
        b=1;
    }else if(b==4||b==6||b==9||b==10){
        b=2;
    }else if(b==2){
        b=3;
    }
    
    if(a==b){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6 + 5;
int a[N], pre[N], suf[N];
int main()
{
	ios::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	int num = n / (m * 2 + 1);
	if(n % (2 * m + 1))
		num ++;
	cout << num << endl;
}


Measured memory_bytes: 256
def f(N,X):
    if N==0:
        return 0 if X<=0 else 1 #レベル0バーガーはパティ1枚
    elif X<=1+a[N-1]: #食べる枚数が半数以下の時
        return f(N-1,X-1) #次数を減らせる、一番下のバンを食べるのでXを1層減らす
    else: #下半分以上食べる時
        return p[N-1]+1+f(N-1,X-2-a[N-1]) 
        #下半分に含まれるパティの枚数+真ん中のパティ+上半分の内、食べるパティを計算
        #食べる層数Xから、下半分の層数に相当するレベルN-1バーガー、バン、パティを差し引く

N,X=map(int,input().split())
#レベル0バーガーはパティ1枚
a=[1]
p=[1]

for i in range(N):
    a.append(a[i]*2+3)
    p.append(p[i]*2+1)

print(f(N,X))

Measured memory_bytes: 9176
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <string>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <cmath>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <sstream>

using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-11;
typedef long long ll;
const ll MOD = 1000000007;
const int N = 100000 + 7;
typedef unsigned long long ull;

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

/*                What if i lose? only losers think like that. But the answer is you will lose rate.                */

int x;

int main() {
#ifndef ONLINE_JUDGE
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif
    fast();

    cin>>x;
    cout<<x+x*x+x*x*x<<endl;

    return 0;
}

Measured memory_bytes: 3640
import sys
import collections

n = int(input())
s = []
for _ in range(n):
	s.append(input())

count = collections.Counter(s)

c = count.most_common()
num = c[0][1]

ans = []
for i,v in c:
	if v == num:
		ans.append(i)
ans.sort()
for i in range(len(ans)):
	print(ans[i])


Measured memory_bytes: 47668
# frozen_string_literal: true

a, b = gets.split(' ').map(&:to_i)

count = 0
(a..b).each do |i|
  arr_i = i.to_s.split('').map(&:to_i)
  count += 1 if arr_i[0] == arr_i[4] && arr_i[1] == arr_i[3]
end

puts count


Measured memory_bytes: 2044
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const long double PI = (acos(-1));
#define rep(i, x, n) for (int i = x; i < (int)(n); i++)
#define sc(x) scanf("%d",&x)
#define scll(x) scanf("%lld",&x)
int main(){
    int ans = 1;
    string s; cin >> s;
    char tmp = s[0];
    rep(i, 1, s.size()){
        if (s[i]!=tmp) ans++, tmp = s[i];
    }
    cout << ans - 1 << endl;
    return 0;
}

Measured memory_bytes: 512
const int LG = 21;
const int FN = 400005;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long INFLL = 1e18;

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define forn(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define fi first
#define se second
#define re return
#define pb push_back
#define uniq(x) sort(all(x)); (x).resize(unique(all(x)) - (x).begin())

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " " << #x << " " << x << endl
#define ln cerr << __LINE__ << endl
#else
#define dbg(x) void(0)
#define ln void(0)
#endif // LOCAL

int cx[4] = {-1, 0, 1, 0};
int cy[4] = {0, -1, 0, 1};
string Ans[2] = {"No", "Yes"};
string ANS[2] = {"NO", "YES"};

ll inq(ll x, ll y)
{
    if (!y) re 1 % MOD;
    ll l = inq(x, y / 2);
    if (y % 2) re l * l % MOD * x % MOD;
    re l * l % MOD;
}

ll rev(ll x)
{
    return inq(x, MOD - 2);
}

bool __precomputed_combinatorics = 0;
vector<ll> __fact, __ufact, __rev;

void __precompute_combinatorics()
{
    __precomputed_combinatorics = 1;
    __fact.resize(FN);
    __ufact.resize(FN);
    __rev.resize(FN);
    __rev[1] = 1;
    for (int i = 2; i < FN; i++) __rev[i] = MOD - __rev[MOD % i] * (MOD / i) % MOD;
    __fact[0] = 1, __ufact[0] = 1;
    for (int i = 1; i < FN; i++) __fact[i] = __fact[i - 1] * i % MOD, __ufact[i] = __ufact[i - 1] * __rev[i] % MOD;
}

ll fact(int x)
{
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[x];
}

ll cnk(int n, int k)
{
    if (k < 0 || k > n) return 0;
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[n] * __ufact[n - k] % MOD * __ufact[k] % MOD;
}

int Root(int x, vector<int> &root)
{
    if (x == root[x]) return x;
    return root[x] = Root(root[x], root);
}

void Merge(int v, int u, vector<int> &root, vector<int> &sz)
{
    v = Root(v, root), u = Root(u, root);
    if (v == u) return;
    if (sz[v] < sz[u])
    {
        sz[u] += sz[v];
        root[v] = u;
    }
    else
    {
        sz[v] += sz[u];
        root[u] = v;
    }
}

int ok(int x, int n)
{
    return 0 <= x && x < n;
}

void bfs(int v, vi &dist, vector<vi> &graph)
{
    fill(all(dist), -1);
    dist[v] = 0;
    vi q = {v};
    for (int i = 0; i < q.size(); i++)
    {
        for (auto u : graph[q[i]])
        {
            if (dist[u] == -1)
            {
                dist[u] = dist[q[i]] + 1;
                q.push_back(u);
            }
        }
    }
}

int A[505][505];

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int a, b, c;
    cin >> a >> b >> c;
    cout << (a + b) * c / 2;
}

/* Note:
Check constants at the beginning of the code.
    N is set to 4e5 but be careful in problems with large constant factor.
    Setting N in every problem is more effective.
Check corner cases.
    N = 1
No def int long long for now.
Add something here.
*/


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

using namespace std;

template<int mod> class modint {
public:
  int x;
  modint(): x(0) {}
  modint(int a) { x = a % mod; if (x < 0) x += mod; }
  modint &operator+=(modint that) { x = (x + that.x) % mod; return *this; }
  modint &operator-=(modint that) { x = (x + mod - that.x) % mod; return *this; }
  modint &operator*=(modint that) { x = (long long) x * that.x % mod; return *this; }
  modint &operator/=(modint that) { return *this *= that.inverse(); }
  modint operator-() { return modint(-this->x); }
  friend ostream& operator<<(ostream &out, modint m) { return out << m.x; }
  modint inverse() {
    int a = x, b = mod, u = 1, v = 0;
    while (b) { int t = a / b; a -= t * b; u -= t * v; swap(a, b); swap(u, v); }
    return modint(u);
  }
#define op(o, p) modint operator o(modint that) { return modint(*this) p that; }
  op(+, +=) op(-, -=) op(*, *=) op(/, /=)
#undef op
#define op(o) bool operator o(modint that) { return x o that.x; }
  op(==) op(!=) op(<) op(<=) op(>) op(>=)
#undef op
};

typedef modint<1000000007> mint;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s; cin >> s;
  long long sum = 0;
  for (int i = 0; i < (1 << s.size() - 1); i++) {
    string str = "";
    str += s[0];
    for (int j = 1; j < s.size(); j++) {
      if (i & (1 << (j - 1))) {
        str += s[j];
      } else {
        sum += stoll(str);
        str = ""; str += s[j];
      }
    }
    sum += stoll(str);
  }
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(false)
#define ll  long long
ll ans[400000], a[400000];

int main()
{
    IO;
    ll i, j, n, m1, m2, k, t,a1,a2, l, th, h, r, mx, pr=.000000001, x, y;
    string s;
    cin>>k>>s; n=s.size();
    if(k>=n) return cout<<s<<endl, 0;
    else for(i=0; i<k; i++) cout<<s[i];
    cout<<"..."<<endl;
    return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto& e : a) {
    cin >> e;
  }
  sort(a.begin(), a.end());
  cout << a[n - 1] - (a[0] + a[n - 1]) / 2 << "\n";
}


Measured memory_bytes: 3144
//BROWNIE TK

#include <bits/stdc++.h>
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define pb push_back
#define popb pop_back()
#define pf push_front
#define popf pop_front()

#define si size()
#define be begin()
#define en end()
#define all(v) v.be, v.en

#define le length()
#define mp make_pair
#define mt make_tuple
#define acc(v) accumulate(all(v), 0)
#define F first
#define S second

#define pll pair<lli, lli>
#define pii pair<int, int>
#define pil pair<int, lli>

#define forz(i, n) for (int i = 0; i < n; i++)
#define fore(i, m, n) for (int i = m; i <= n; i++)
#define rforz(i, n) for (int i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (int i = n; i >= m; i--)

#define deci(n) fixed << setprecision(n)
#define high(n) __builtin_popcount(n)
#define highll(n) __builtin_popcountll(n)
#define parity(n) __builtin_parity(n)
#define ctz(n) __builtin_ctz(n)

#define bset(a, p) ((a) | (1ll << (p)))
#define bchk(a, p) ((a) & (1ll << (p)))
#define bxor(a, p) ((a) ^ (1ll << (p)));
#define brem(a, p) (bchk(a, p) ? (bxor(a, p)) : (a))
/*SOME BITMASK KNOWLEDGE
1)x & (x - 1):sets the last one bit of x to zero
power of two exactly when x & (x − 1) = 0.
2)x & -x:sets all the one bits to zero, except last one bit
3)x | (x - 1):inverts all the bits after the last one bit*/

#define lb lower_bound
#define ub upper_bound
#define er equal_range

#define findnot find_first_not_of

#define maxe *max_element
#define mine *min_element

#define mod 1000000007
#define mod2 998244353
#define gcd __gcd
#define kira ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

#define oset tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define osetlli tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements sbtriectly lesser than k
//2. find_by_order(k) : k-th element in the set
#define ofk order_of_key
#define fbo find_by_order
using namespace std;

/*STD funcions*/
lli power(lli x, lli y, lli p)
{
    lli res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
lli modi(lli a, lli m) { return power(a, m - 2, m); }
/*CODE BEGINS*/
int main()
{
    kira;
    lli a,b;
    cin>>a>>b;
    cout<<6-a-b;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
struct __fastio__{ __fastio__() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); } } __fast_io__;
template<class T, class U> bool chmin (T &a, const U &b) { if (a > b) { a = b; return 1; } return 0; }
template<class T, class U> bool chmax (T &a, const U &b) { if (a < b) { a = b; return 1; } return 0; }

int main() {
	int n;
	std::cin >> n;
	std::vector<int> a(n), b(n), ans;
	for (int &e : a) { std::cin >> e; }
	for (int &e : b) { std::cin >> e; }

	const int s = (n >> 1);
	for (int i = s; i < n; i++) ans.push_back(b[i]);
	for (int i = 0; i < s; i++) ans.push_back(b[i]);
	
	bool ok = true;
	for (int i = 0; i < n; i++) {
		ok &= (a[i] != ans[i]);
	}
	
	if (ok) {
		std::cout << "Yes" << '\n';
		for (int i = 0; i < n; i++) {
			std::cout << ans[i] << " \n"[i + 1 == n];
		}
	} else {
		std::reverse(b.begin(), b.end());
		bool flag = true;
		for (int i = 0; i < n; i++) {
			flag &= (a[i] != b[i]);
		}
		if (flag) {
			std::cout << "Yes" << '\n';
			for (int i = 0; i < n; i++) {
				std::cout << b[i] << " \n"[i + 1 == n];
			}
		} else {
			std::cout << "No" << '\n';
		}
	}
}

Measured memory_bytes: 5840
#include "iostream"
#include "vector"
#include "string"
#include "algorithm"
#include "math.h"
#include "cstring"
#include "stack"
#include "queue"

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<vector<int> > mat;

int main()
{
  string s;
  cin >> s;
  int size = s.size();
  string ans = "";
  for (int i = 0; i < size; i++)
  {
    if (s[i] == 'B')
    {
      if (ans.size() != 0)
      {
        ans.erase(ans.begin()+ans.size()-1);
      }
    }
    else
    {
      ans = ans + s[i];
    }
  }
cout << ans << "\n";
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;


public class Main{

	private static int n;
	private static int p_cnt[];
	private static final int SIZE = 1000000;

	public static void main(String args[]) throws Exception {

		p_cnt = new int[SIZE];
		p_cnt[1] = 0;
		p_cnt[2] = 0;
		p_cnt[3] = 1;
		for(int i=3;i<SIZE;i = i+2){
			boolean isPnum = true;
			for(int j=3;j<=Math.sqrt(i);j+=2)
			{
				if(i%j==0)
				{
					isPnum = false;
					break;
				}
			}
			if(isPnum){
				p_cnt[i] = p_cnt[i-2]+1;
			}
			else{
				p_cnt[i] = p_cnt[i-2];
			}
			
		}
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		while ((line = br.readLine()) != null ) {
			n = Integer.parseInt(line);
			
			if(n % 2 == 0 && n > 2){
				System.out.println(p_cnt[n-1]+1);
			}
			else if(n == 1){
				System.out.println(p_cnt[n]);
			}
			else {
				System.out.println(p_cnt[n]+1);
			}
		}
	}
}

Measured memory_bytes: 23496
// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
#define N 12

bool dfs(int i, int j, int** A, int** use){
    if(use[i][j]==1)return false;
    use[i][j] = true;
    if(A[i][j]==0)return false;
    //----------
    if(i+1<N){        
        dfs(i+1, j, A, use);
    }
    if(i-1>=0){        
        dfs(i-1, j, A, use);
    }
    if(j+1<N){        
        dfs(i, j+1, A, use);
    }
    if(j-1>=0){        
        dfs(i, j-1, A, use);
    }
    return true;
}

int main()
{   while(true){
    string str[N];
    int i,j;
    int** A;
    int** use;
    A = (int**)malloc(N*sizeof(int*));
    A[0] = (int*)malloc(N*N*sizeof(int));
    for(i=0; i<N; i++){
        A[i] = A[0] + i*N;
    }
    use = (int**)malloc(N*sizeof(int*));
    use[0] = (int*)malloc(N*N*sizeof(int));
    for(i=0; i<N; i++){
        use[i] = use[0] + i*N;
    }
    for(i=0; i<N; i++){
        for(j=0; j<N; j++){
            A[i][j] = 0;
            use[i][j] = 0;
        }
    }
    
    for(i=0; i<N; i++){
        if(!(cin >> str[i]))return 0;
        for(j=0; j<N; j++){
            A[i][j] = '1' == str[i][j];
        }
    }
    
    int count = 0;
    for(i=0; i<N; i++){
        for(j=0; j<N; j++){
            count += dfs(i, j, A, use);
        }
    }
    cout << count << endl;
    }    
    return 0;
}

// GCC reference:
//   https://gcc.gnu.org/

// C++ language references:
//   https://cppreference.com/
//   https://isocpp.org/
//   http://www.open-std.org/jtc1/sc22/wg21/

// Boost libraries references:
//   https://www.boost.org/doc/



Measured memory_bytes: 3152
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	double r,IP = 3.141592653589;
    	r = scan.nextDouble();
    	System.out.printf("%.6f %.6f\n",r*r*IP,2*r*IP);
    }
}

Measured memory_bytes: 19036
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>
#include <deque>
#include <string.h>
using namespace std;

#define REP(i,n) for(int i = 0; i < n; i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef pair<string,string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

double EPS = 1e-9;
int INFi = 1000000005;
long long INFll = 1000000000000000005ll;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};
ll MOD = 1000000007;

string S;

int main(){
  cin >> S;
  if(S.length() < 26) {
    map<char, int> mp;
    REP(i, S.length()){
      mp[S[i]]++;
    }
    REP(i, 26) {
      if(mp[char('a' + i)] == 0) {
        cout << S + char('a' + i) << endl;
        return 0;
      }
    }
  } else if(S == "zyxwvutsrqponmlkjihgfedcba") {
    cout << -1 << endl;
    return 0;
  } else {
    map<char, int> mp;
    priority_queue<char> pq;
    pq.push(S[25]);
    mp[S[25]]++;
    int i = 24;
    while(S[i] > pq.top()) {
      pq.push(S[i]);
      mp[S[i]]++;
      i--;
    }
    REP(j, 26) {
      if(char('a'+ j) > S[i] && mp[char('a' + j)] > 0) {
        cout << S.substr(0, i) + char('a' + j) << endl;
        return 0;
      }
    }

  }
}



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

int main(){
  int h1, m1, h2, m2, k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  if(h1 == h2){
    cout << m2-m1-k << endl;
  }else{
    cout << (h2-h1-1)*60+(60-m1)+m2-k << endl;
  }
  return 0;
}

Measured memory_bytes: 3636
X = int(input())
#N, M = map(int, input().split())
# a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
# c=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力の

if X >= 30:
    print('Yes')
else:
    print('No')

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

using namespace std;

int main(){
    
    int n;
    cin>>n;
    string l;
    cin>>l;
    stack<char> s;
    
    for(int i=0; i <n; i ++){
        if(s.empty()){
            s.push(l[i]);
            continue;
        }
        
        if(l[i]!=s.top())s.push(l[i]);
    }
    cout<<s.size()<<endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
typedef long long int ll;

#define PI (acos(-1))
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define dumparr(x) cerr << #x ; for(auto elem: x){cerr << " " << elem;} cerr << endl;
#define dumppairs(x) cerr << #x ; for(auto elem: x){cerr << "(" << elem.first << " " << elem.second << ") ";} cerr << endl;
#define dumpline cerr << "**********************" << endl;
#define dumpwline(x) cerr << "******** " << #x << "=" << (x) << " ********" << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

int main(void){
    ll a; cin >> a;
    ll b; cin >> b;
    REP(i, 10000){
        if (((i*8) / 100 == a) && ((i*10) / 100 == b)){
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 256
//In The Name Of Allah
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define pob pop_back
#define forr(x) for(int i = 0; i < x; i++)
#define forrr(x) for(int j = 0; j < x; j++)
#define F first
#define S second
#define endl '\n'
#define pi pair<ll, ll>
#define mp make_pair
const ll N = 3e5 + 5, inf = 1e9 + 5;

int n;
int k;
int h[N];
int dp[N];

int main(){
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	cin >> n >> k;
	forr(n)
		cin >> h[i];
	for(int i = 1; i < n; i++)
	{
		dp[i] = inf;
		for(int j = i - 1; j >= max(0, i - k); j--)
		{
			dp[i] = min(dp[i], dp[j] + abs(h[i] - h[j]));
		}
	}
	cout << dp[n - 1] << endl;
	return 0;
}


Measured memory_bytes: 1024
n = int(input())
a = list(map(int,input().split()))

l = [0] * (2*10**5)
for i in a:
    l[i-1] += 1

ans = 0
for i in l:
    ans += i*(i-1)//2

for i in range(n):
    print(ans-l[a[i]-1]*(l[a[i]-1]-1)//2+(l[a[i]-1]-1)*(l[a[i]-1]-2)//2)

Measured memory_bytes: 24744
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

typedef long long ll;
typedef uint64_t ull;
typedef pair<int, int> P;
constexpr double PI = 3.1415926535897932;   // acos(-1)
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)

template<int mod>
struct ModInt{
    int x;

    ModInt() : x(0) {}
    
    ModInt(int64_t 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;
            swap(a -= t * b, b);
            swap(u -= t * v, v);
        }
        return ModInt(u);
    }

    ModInt pow(int64_t n) const{
        ModInt ret(1), mul(x);
        while(n > 0){
            if(n & 1)   ret *= mul;
            mul *= mul;
            n >>= 1;
        }
        return ret;
    }

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

    friend istream &operator>>(istream &is, ModInt &a){
        int64_t t;
        is >> t;
        a = ModInt<mod>(t);
        return (is);
    }

    static int get_mod() {return mod;}
};

using modint = ModInt<mod>;

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

    int n;
    cin >> n;
    vector<int> x(n);
    for(int i = 0; i < n; ++i)  cin >> x[i];

    vector<modint> Factorial(n);
    Factorial[0] = 1;
    for(int i = 1; i < n; ++i){
        Factorial[i] = Factorial[i - 1] * i;
    }

    vector<modint> w(n - 1);
    w[0] = 1;
    for(int i = 1; i < n - 1; ++i){
        w[i] = w[i - 1] + modint(1) / (i + 1);
    }

    modint ans = 0;
    for(int i = 0; i < n - 1; ++i){
        ans += modint(x[i + 1] - x[i]) * w[i];
    }
    ans *= Factorial[n - 1];
    cout << ans << endl;
}

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

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

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

int getRand(int l, int r)
{
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}
  
#define int long long 
#define pb push_back
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int,int>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define precise(x) fixed << setprecision(x) 

const int MOD = 1e9+7;

int mod_pow(int a,int b,int M = MOD)
{
    int res = 1;
    
    while(b)
    {
        if(b&1) res=(res*a)%M;
        a=(a*a)%M;
        b>>=1;
    }
    
    return res;
}


void solve()
{
  char c;
    cin >> c;
    
    if(c >= 'A' && c <= 'Z') cout << 'A';
    else cout << 'a';
    
    
}

signed main()
{
    fast;
    
    int t = 1;
    
//    cin >> t;
    
    while(t--)
        
    solve();
}

Measured memory_bytes: 3600
//BadWaper gg
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<deque>
#include<bitset>
#include<map>
#include<set>
#define inf 1e9
#define eps 1e-6
#define mp make_pair
#define N 200010
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
inline ll read()
{
	char ch=getchar();
	ll s=0,w=1;
	while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){s=s*10+ch-'0';ch=getchar();}
	return s*w;
}
int n;
int a[N],tot,p[N];
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	n=read();
	for(register int i=1;i<=n;i++)a[i]=p[i]=read();
	sort(p+1,p+n+1);tot=unique(p+1,p+n+1)-p-1;
	for(register int i=1;i<=n;i++){a[i]=lower_bound(p+1,p+tot+1,a[i])-p;}
	int ans=0;
	for(register int i=1;i<=n;i++)if(a[i]%2!=i%2)ans++;
	printf("%d\n",ans/2);
	return 0;
}


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

int main()
{
    long long N, W;
    cin >> N >> W;

    vector<long long> w(N + 1, 0);
    vector<long long> v(N + 1, 0);
    for (int i = 1; i <= N; i++)
    {
        cin >> w[i] >> v[i];
    }

    vector<vector<long long>> dp(N + 1, vector<long long>(1000 * N + 1, W + 1));
    dp[0][0] = 0;
    for (int i = 1; i <= N; i++)
    {
        for (int j = 0; j < dp[i].size(); j++)
        {
            dp[i][j] = min(dp[i][j], dp[i - 1][j]);
            if (j + v[i] < dp[i].size())
            {
                dp[i][j + v[i]] = min(dp[i][j + v[i]], dp[i - 1][j] + w[i]);
            }
        }
    }

    long long ans = 0;
    for (int i = 0; i < dp.back().size(); i++)
    {
        if (dp.back()[i] <= W)
        {
            ans = max(ans, (long long)i);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 81520
n = input()
acount = 0
bcount = 0
ccount = 0
for s in n:
    if s == 'a':
        acount+=1
    if s == 'b':
        bcount+=1
    if s == 'c':
        ccount+=1
if acount == 1 & bcount == 1 & ccount == 1:
    print('Yes')
else:
    print('No')

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

int main(){
  long int n,d;
  cin>>n>>d;
  long int x,y;
  int j=0;
  for(int i=0; i<n; i++){
    cin>>x>>y;
    if(x*x+y*y<=d*d){
      j++;
    }
  }
  cout<<j<<"\n";
    
  return 0;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
using namespace std;
//using namespace boost::multiprecision;

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}



int main(){
  
  string s,t;
  cin>>s>>t;
  string ans = t + s;
  cout<<ans<<endl;
  return 0; 
}


Measured memory_bytes: 256
//
//AtCoder Beginner Contest 066
//C
//

#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <functional>
#include <cassert>

using namespace std;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define SIZE(x) (int)(x).size()
#define SIZEL(x) (ll)(x).size()
#define MSG(a) cout << #a << " " << a << endl;

using ll = long long;
using ld = long double;

const double PI = 3.14159265358979323846;

ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }    //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }            //最小公倍数

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

    vector<int> a(n);
    REP(i, n) cin >> a[i];
    vector<int> ans;
    for(int i=n-1; i>=0;i-=2){
        ans.push_back(a[i]);
    }
    for(int i=n%2; i<n; i+=2){
        ans.push_back(a[i]);
    }
    REP(i,n) cout << ans[i] << " ";
    cout << endl;
    return 0;
}


Measured memory_bytes: 5088
<?php
$input = file_get_contents('php://stdin');
$inarr = array_map(function ($e) {
  return explode(" ", $e);
}, explode("\n", $input));

$n = intval($inarr[0][0]);
$m = intval($inarr[0][1]);

$t = array_splice($inarr, 1, $m);

$k = array_map(function ($e) {
  return $e[0];
}, $t);

$v = array_map(function ($e) {
  return $e[1];
}, $t);


$num = str_split(str_pad("1", $n, "0"));
if ($n == 1) {
  $num[0] = "0";
}

for ($i = 0; $i < $m; $i++) {
  $keta = $k[$i];
  $val = $v[$i];
  $key = array_search($keta, $k);
  if ($key !== false && $v[$key] != $val) {
    echo "-1";
    exit(0);
  }
  $num[$keta - 1] = $val;
}

if ($n != 1 && $num[0] == "0") {
  echo "-1" . PHP_EOL;
} else {
  echo implode("", $num) . PHP_EOL;
}


Measured memory_bytes: 4604
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
    int n;cin>>n;
    int a,b,ans;
    a=n/11;b=n%11;
    if(b==0)ans=2*a;
    else if(b<=6) ans=2*a+1;
    else ans=2*a+2;
    cout <<ans<<endl;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n ; i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) // decltypeで型取得、引数があればva_argsのところに入れる
using namespace std;
typedef long long ll; // long longをllでかけるようにした
const int INF = 1e9;
const double PI = 3.1415926535;
const int MOD = 1000000007; // 計算してからmodで割る ans = (ans * a) % mod
#define int long long
template <typename T = long long > T in () { T x; cin >> x; return(x);}
// int a = in() のように使うlong long以外の型の時はstirng s = in<string>()のように型を指定する

signed main(void){
    int n = in();
    string s; cin >> s;

    char number[10] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};

    vector<string> num;
    int ans = 0;

    REP(i, 10){
        REP(j, 10){
            REP(k, 10){
                string tmp = {number[i], number[j], number[k]};
                num.push_back(tmp);
            }
        }
    }

    REP(i, num.size()){
        int j = 0, now = 0;
        while(j < s.size()){
            if(num[i][now] == s[j]){
                now++;
                if(now == 3){
                    ans++;
                    break;
                }
            }
            j++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 384
import fractions
#import math
from functools import reduce

N = int(input())
T =[int(input()) for i in range(N)]

def lcm_base(x,y):
    return (x*y) // fractions.gcd(x,y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm(*T))


Measured memory_bytes: 5048