akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int a;
    std::deque<int> ri;
    std::deque<int> sya;
    for (int i=0;i<4;i++) {
        cin>>a;
        ri.emplace_back(a);
    }
    for (int k=0;k<2;k++) {
        cin>>a;
        sya.emplace_back(a);
    }
    sort(ri.begin(),ri.end(),greater<int>());
    sort(sya.begin(),sya.end(),greater<int>());
    int score=0;
    for (int l=0;l<3;l++) {
        score+=ri[l];
    }
    for (int m=0;m<1;m++) {
        score+=sya[m];
    }
    cout<<score<<endl;
}


Measured memory_bytes: 3136
#include <bits/stdc++.h>
#define INF INT_MAX
#define ll  long long
#define ull unsigned long long
#define rep(i,n) for(ll i=0; i<n; ++i)
#define FOR(i, s, e) for(ll i=s; i<e; ++i)
#define MOD 1000000007
using namespace std;
template<class T> inline bool chmin(T& a, T b) { if(a>b) {a=b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) { if(a<b) {a=b; return true;} return false;}

ll ModInv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}
 
ll Combi(const int& n, const int& k) {
  ll value = 1LL;
  for (int i = n; i > n - k; i--) {
    value = (value * i) % MOD;
  }
  for (int i = k; i > 1; i--) {
    value = (value * ModInv(i, MOD)) % MOD;
  }
  return value;
}
 
int main() {
  int x, y;
  cin >> x >> y;
  if (x < y) swap(x, y);
  int diff = x - y;
  if (y - diff < 0 || (y - diff) % 3 != 0) {
    cout << 0 << endl;
    return 0;
  }
  int count_a = (y - diff) / 3 + diff;
  int count_b = (y - diff) / 3;
  cout << Combi(count_a + count_b, count_b) << endl;
  return 0;
}

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

int main() {
    int n;
    cin >> n;
    vector<string> hai(n);

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

    sort(hai.begin(), hai.end());

    int s = 1;
    for(int i = 0; i < n - 1; i++){
        if(hai[i] != hai[i + 1]){
            s++;
        }
    }
    cout << s << endl;
}

Measured memory_bytes: 9612
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
const int INF = 100000000;
using namespace std;

int main(){
    int n, m, t;
    int a[30000] = {0};
    cin >> n >> m >> t;
    rep(i,n){
        int inp;
        cin >> inp;
        a[max(0, inp - m)]++;
        a[min(t, inp + m)]--;
    }
    int cnt = 0;
    int c = 0;
    rep(i,t){
        c+=a[i];
        if(c == 0) cnt++;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 3176
#include<cstdio>
#define RI register int
#define CI const int&
using namespace std;
const int N=505;
int n,k,a[N][N];
int main()
{
	RI i,j,t; scanf("%d",&k); n=(k+3)/4*2;
	if (k==1) return puts("1\n1"),0;
	for (i=0;i<n;++i) for (j=0;j<n;++j) a[i][j]=(i+j)%n;
	for (t=n;t<k;++t) for (i=0;i<n;++i) for (j=0;j<n;++j)
	if (t%n==a[i][j]) a[i][j]+=(i&1)*n; printf("%d\n",n);
	for (i=0;i<n;++i) for (j=0;j<n;++j) printf("%d%c",a[i][j]+1," \n"[j==n-1]);
	return 0;
}

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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;
const int NIL = -1;

#define rep(i,n) for(int i=0; i<(n); ++i)
#define all(n) n.begin(),n.end()

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

#define DEBUG

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

	ll sum = 0;
	rep(i, n) sum += a[i];

	cout << (sum >= h ? "Yes" : "No") << endl;
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull = unsigned long long;using ld=long double;template<typename T>void _(const char*s,T h){cerr<<s<<" = "<<h<<"\n";}template<typename T,typename...Ts>void _(const char*s,T h,Ts...t){int b=0;while(((b+=*s=='(')-=*s==')')!=0||*s!=',')cerr<<*s++;cerr<<" = "<<h<<",";_(s+1,t...);}// break continue pop_back 998244353
#define int ll
#define pii pll
#define f first
#define s second
#define pb emplace_back
#define forn(i,n) for(int i=0;i<(n);++i)
#define sz(a)((int)(a).size())
#define sqr(x) ((x)*(x))
struct init{init(){cin.tie(0);iostream::sync_with_stdio(0);cout<<fixed<<setprecision(10);cerr<<fixed<<setprecision(5);}~init(){
#ifdef LOCAL
#define dbg(...) _(#__VA_ARGS__,__VA_ARGS__)
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#else
#define dbg(...) 
#endif
}}init;template<typename T,typename U>void upx(T&x,U y){if(x<y)x=y;}template<typename T,typename U>void upn(T&x,U y){if(x>y)x=y;}mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());const int D=4,dx[]={+1,0,-1,0},dy[]={0,+1,0,-1};
const int N=1e5+5;
int a[N];
struct g{
    int ans;
    vector<int> w;
};
g f(vector<pii> v){
    if(v.empty())return g{-1};
    vector<int> w;int su=0;
    forn(i,sz(v)){
        if(v[i].f>0){
            w.pb(v[i].s);
            su+=v[i].f;
        }
    }
    return g{su,w};
}
int32_t main(){
    int n;
    cin>>n;
    vector<pii> b,c;
    int as=1,wmx=0;
    forn(i,n){
        cin>>a[i];
        if(a[i]>a[wmx])wmx=i;
        if(a[i]>0)as=0;
        if(i&1)c.pb(a[i],i+1);
        else b.pb(a[i],i+1);
    }
    vector<int> ans;
    if(as){
        cout<<a[wmx]<<'\n';
        forn(i,n-wmx-1)ans.pb(n-i);
        forn(i,wmx)ans.pb(1);
    }else{
        auto sol=f(b),gc=f(c);
        if(gc.ans>sol.ans)sol=gc;
        cout<<sol.ans<<'\n';
        for(int j:sol.w)dbg(j);
        forn(i,n-sol.w.back())ans.pb(n-i);
        forn(i,sol.w[0]-1)ans.pb(1);
        forn(i,sz(sol.w)-1){
            int d=sol.w[i+1]-sol.w[i];
            forn(j,d/2-1)ans.pb(3);
            ans.pb(2);
        }
    }
    cout<<sz(ans)<<'\n';
    for(int i:ans)cout<<i<<'\n';
    return 0;
}

Measured memory_bytes: 3692
#include <iostream>
#include <vector>
#include <queue>
using namespace std;

int main(){
    int64_t N,P,Q;
    cin>>N>>P>>Q;
    priority_queue<int64_t> que;

    int64_t sum = 0;
    for(int i=0;i<N;i++){
        int64_t C;
        cin>>C;
        sum+=C;
        que.push(P*(Q-i)-C);
    }
    int64_t ans = sum;
    for(int D=0;D<N;D++){
        int64_t t = que.top(); que.pop();
        sum+=t+D*2*P;
        //cout<<t<<' '<<D*2*P<<' '<<sum<<endl;
        ans=max(ans,sum);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 7044
n = int(input())
l = list(map(int, input().split()))
l.append(0)

m = 1000
s = 0

for i in range(n):
    if l[i+1] > l[i]:
        s += m//l[i]
        m %= l[i]
    elif l[i+1] < l[i]:
        m += s * l[i]
        s = 0
        
print(m)

Measured memory_bytes: 8824
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<map>
#include<numeric>
#include<set>
#include<string>
#include<utility>
#include<vector>

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define per(i, a, n)  for(int i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define MAX 1000000000
using namespace std;
typedef long long ll;

int main(){
  ll x;  cin >> x;
  ll m = (x-6)/11;
  ll n = m+1;
  if(6*n+5*m<x) m++;
  if(6*n+5*m<x) n++;
  cout << n+m << endl;
  return 0;
}

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

using namespace std;

int main(void){
    string s;
    int n,k;
    cin>>n>>k;
    cin>>s;
    switch(s[k-1]){
        case 'A':
            s[k-1]='a';
            break;
        case 'B':
            s[k-1]='b';
            break;
        default:
            s[k-1]='c';
            break;
    }
    cout<<s<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<algorithm>
#include<string>
#include<vector>
#define _USE_MATH_DEFINES
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include <numeric>
#include <cmath>
#include <limits>
using namespace std;


int main()
{
	int n,minNum=1000000,tmp=0;
	cin >> n;
	vector<int>w(n);
	for (int& x : w)cin >> x;
	for (int i = 0; i < n; i++) {
		tmp = accumulate(w.begin(), w.begin() + (i+1), 0)- accumulate(w.begin()+(i+1), w.end(), 0);
		minNum = min(minNum, abs(tmp));
	}
	cout << minNum << endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mod 1000000007
#define int long long int
#define phi 1.6180339
#define rep(i,n) for(auto i=0;i<(n);i++)
#define endl "\n"
#define For(i,a,b) for(auto i=(a);i<(b);i++)
#define op1 cin.tie(NULL)
#define op2 cout.tie(NULL)
#define op3 std::ios_base::sync_with_stdio(false)
#define MAXX 100011
using namespace std;
//vector<int> arr(MAXX);
bool visited[MAXX];
int arr[MAXX];
int solve(int i,int n)
{
    if(i==n)
        return 1;
    if(i>n)
        return 0;
    if(arr[i]!=-1)
        return arr[i];
    int ans1=0,ans2=0;
    if(visited[i+1]) ans1=solve(i+1,n);
    if(visited[i+2]) ans2=solve(i+2,n);
    return arr[i]=(ans1%mod+ans2%mod)%mod;

}
void trozen()
{
    int n,m;
    cin>>n>>m;
    rep(i,MAXX) arr[i]=-1,visited[i]=true;
    rep(i,m){int temp;cin>>temp;visited[temp]=false;}
    int ans=solve(0,n);
    cout<<ans<<endl;

}
int32_t main()
{
    op1;op2;op3;
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/
    trozen();
    return 0;
}


Measured memory_bytes: 9112
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <string>
#include <bitset>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define fin(ans) cout<<(ans)<<endl
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p,q)
#define pb(n) push_back(n)
#define Sort(a) sort(a.begin(),a.end())
#define Rort(a) sort(a.rbegin(),a.rend())
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const int P = 1000000007;
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
//g++ -std=c++1z main.cpp
//.\a.exe

int main(void){ios::sync_with_stdio(false);cin.tie(0);
///////////////////////////////////////////////////////
int n,d,x,ans=0;
cin >> n >> d >> x;
int A[n];
for(int i=0;i<n;i++){
	cin >> A[i];
}
for(int i=0;i<n;i++){
 for(int j=0;j<d;j++){
	if(A[i]*j+1<=d){
		ans++;
	}
 } 
}
cout << ans+x << endl;
///////////////////////////////////////////////////////
return 0;}

Measured memory_bytes: 256
if __name__ == '__main__':
    from sys import stdin
    input = stdin.readline
    from collections import Counter

    import random

    n = int(input())
    aa = list(map(int, input().split()))
    if n%2 == 0:
        dp = [[0]*n for _ in range(2)]
        dp[0][0] = aa[0]
        dp[1][1] = aa[1] if aa[1]>aa[0] else aa[0]
        for i in range(2, n, 2):
            aa_i = aa[i]
            dp[0][i] = dp[0][i-2]+ aa_i

            aa_i_p_1 = aa[i+1]
            dp_i_1 = dp[1][i-1]
            next = (dp_i_1+aa_i_p_1) if (dp_i_1+aa_i_p_1 > dp[0][i]) else dp[0][i]
            dp[1][i+1] = next
        print(dp[1][n-1])

    else:
        dp = [[0]*n for _ in range(3)]
        dp[0][0] = aa[0]
        dp[1][1] = aa[1] if aa[1]>aa[0] else aa[0]
        for i in range(2, n, 2):
            aa_i = aa[i]
            dp[0][i] = dp[0][i-2]+ aa_i
            dp_i_2 = dp[2][i-2]
            dp[2][i] = dp_i_2+aa_i if dp_i_2+aa_i > dp[1][i-1] else dp[1][i-1]

            if i == n-1:
                break
            aa_i_p_1 = aa[i+1]
            dp_i_1 = dp[1][i-1]
            dp[1][i+1] = dp_i_1+aa_i_p_1 if dp_i_1+aa_i_p_1 > dp[0][i] else dp[0][i]
        print(dp[2][n-1])

Measured memory_bytes: 38600
#include <bits/stdc++.h>
#define ll int
using namespace std;
void LCS(string &text1, string &text2, string &res) {
    int l1 = (ll)text1.size();
    int l2 = (ll)text2.size();
    int dp[l1+2][l2+2];
    for(int i=0; i<=l1; i++)
        dp[i][0] = 0;
    for(int j=0; j<=l2; j++)
        dp[0][j] = 0;
    for(int i=1; i<=l1; i++)
    {
        for(int j=1; j<=l2; j++)
        {
            if(text1[i-1] == text2[j-1])
                dp[i][j] = 1+dp[i-1][j-1];
            else
                dp[i][j] = max(dp[i][j-1], dp[i-1][j]);
        }
    }
    ll i=l1, j=l2;
    while(i>=1 && j>=1)
    {
        if(text1[i-1] == text2[j-1])
        {
            res+= text1[i-1];
            i--;
            j--;
        }
        else if(dp[i-1][j] > dp[i][j-1])
            i--;
        else
            j--;
    }
    reverse(res.begin(), res.end());
}
string longestCommonSubsequence(string &a, string &b) {
    string res = "";
    LCS(a, b, res);
    return res;
}

int main()
{
	string a, b;
	cin>>a>>b;
	cout<<longestCommonSubsequence(a, b);
	return 0;
}

Measured memory_bytes: 38804
#include <iostream>
#include <string.h>
#include <algorithm>
#include <vector>
#include <queue>

using namespace std;
typedef long long ll;
const ll INF=100000000000000LL;

int main() {
	ll n,t[200001],t1;
	cin>>n>>t1;
	cin>>t[0];
	ll r=0,l=t1;
	for(int i=1;i<n;++i){
		cin>>t[i];
		r+=min(t1,t[i]-t[i-1]);
	}
	r+=t1;
	cout<<r<<endl;
	return 0;
}


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

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    cout << ((a+b)*c)/2 << endl;

    return 0;
}

Measured memory_bytes: 256
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main()
    {
        double[] s = Console.ReadLine().Split().Select(i => double.Parse(i)).ToArray();
        double n = s[0];
        double k = s[1];
        string iranai = Console.ReadLine();

        Console.WriteLine(Math.Ceiling((n - 1) / (k - 1)));
    }
}

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

const int N=200001;
ll bit[N+2];

ll query(ll i)
{
	ll mx=0;
	while(i>0)
	{
		mx=max(bit[i],mx);
		i-=i&(-i);
	}
	return(mx);
}
void update(ll i,ll val)
{
	while(i<=N)
	{
		bit[i]=max(val,bit[i]);
		i+=(i&(-i));
	}
}
int main()
{
	ll n;
	cin>>n;
	ll i;
	ll a[n+1]={0};
	ll h[n+1]={0};
	memset(bit,0,sizeof(bit));
	for(i=1;i<=n;i++)
	{
		cin>>h[i];
	}
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	map<ll,pair<ll,ll> >mp;
	for(i=1;i<=n;i++)
	{
		mp[h[i]]=make_pair(a[i],i);
	}
	sort(h,h+n+1);
	ll ans=INT_MIN;
	for(i=1;i<=n;i++)
	{
		ll p=mp[h[i]].second;
		ll x=query(p-1);
		ans=max(x+mp[h[i]].first,ans);
		update(p,x+mp[h[i]].first);
	}
	cout<<ans<<"\n";
}

Measured memory_bytes: 20760
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<stack>
#include<cstring>
#include<string>
using namespace std;
int a[100050];
int main()
{
    int n,nn,sum=0;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(int i=1;i<=n;i++)
        if(a[i]==i)
    {
        nn=a[i];
        a[i]=a[i+1];
        a[i+1]=nn;
        sum++;
    }
    printf("%d\n",sum);
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <string>
using namespace std;
typedef long long ll;

const int MAX = 510000;
const ll MOD = 1000000007;

ll fac[MAX], finv[MAX], inv[MAX];
ll A[MAX] = { 0 };
ll B[MAX] = { 0 };
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
ll COM(int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    // 前処理
    COMinit();
    int n, k;
    cin >> n >> k;
    ll sumA = 0;
    ll sumB = 0;
    for (int i = 1; i <= n; i++) {
        cin >> A[i];
        if (n - i >= k - 1) { 
            B[i] = COM(n - i, k - 1);
        }
    }
    sort(A+1, A+n+1);
    for (int i = 1; i <= n - k + 1;i++) {
        sumA += A[i] * B[i]%MOD;
        sumA %= MOD;
        sumB += B[i] * A[n + 1 - i]%MOD;
        sumB %= MOD;
    }
    ll ans = (sumB - sumA)%MOD;
    if (ans < 0)ans += MOD;
    cout << ans << endl;
}

Measured memory_bytes: 18560
def tapdance(s):
    for i in range(len(s)):
        if i % 2 == 0:
            if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
                return 'No'
        else:
            if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
                return 'No'
    return 'Yes'
s = input()
print(tapdance(s))


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
int main(){
      int N,X,T,ans;
      cin >> N >> X >> T;
      if(N%X==0)
           ans =  (N/X)*T;
      else
          ans = (N/X+1)*T;
      cout << ans << "\n";
     return 0;
}  

Measured memory_bytes: 3596
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        long sum2 = 0;
        for (int i = 1; i <= n; i++) {
            String str = String.valueOf(i);
            int sum = 0;
            for (int j = 0; j < str.length(); j++) {
                sum += Integer.parseInt(String.valueOf(str.charAt(j)));
            }
            
            if (a <= sum && sum <= b) {
                sum2 = sum2 + i;
            }
        }
        System.out.println(sum2);
    }
}


Measured memory_bytes: 24276
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int X, A;cin >> X >> A;
    if (X < A) {
        cout << 0 << endl;
    } else {
        cout << 10 << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int N, T;
  cin >> N >> T;
  int c[100] = {};
  int a[100] = {};
  int t, A;
  A = 0;
  for(int i = 0;i < N;i++){
    cin >> c[i] >> t;
    if(t <= T){
      a[A] = c[i];
      A++;
    }
  }
  sort(a,a+A);
  if(A == 0){
    cout << "TLE" << endl;
  }else{
    cout << a[0] << endl;
  }
}

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

int main() {
  int N,l,r;
  cin >> N;
  int A;
    A=0;
  for(int i=0; i<N; i++){
    cin >> l >> r;
    A+=r-l+1;
  }
  cout << A << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
#define rep(i, n) for (int i = 0; i < (n); i++)
using P=pair<int,int>;
int main() {
    int n,m;cin>>n>>m;
    vector<P> manu(m);
    vector<int> ball(n+1);
    vector<bool> red(n+1);
    for(int i=0;i<m;i++){
        cin>>manu[i].first>>manu[i].second;
    }
    rep(i,n+1){
        ball[i]=1;
        red[i]=false;
    }
    red[1]=true;
    rep(i,m){
        ball[manu[i].first]--;
        ball[manu[i].second]++;
        if(red[manu[i].first]==true){
            red[manu[i].second]=true;
        }
        if(ball[manu[i].first]==0){
            red[manu[i].first]=false;
        }
    }
    int ans=0;
    rep(i,n+1){
        if(red[i]==true) ans++;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1408
#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int N;
	long long D;
	cin >> N >> D;
	vector<long long> X(N), Y(N);
	for (int i = 0; i < N; ++i) {
		cin >> X[i] >> Y[i];
	}

	int ans = 0;
	for (int i = 0; i < N; ++i) {
		if (X[i] * X[i] + Y[i] * Y[i] <= D * D) {
			++ans;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 6376
import sys
import numpy as np
input = sys.stdin.readline


def log(*args):
    print(*args, file=sys.stderr)


def main():
    np.set_printoptions(threshold=20)
    K = int(input())
    if K % 2 == 0 or K % 5 == 0:
        print(-1)
        return
    cnt = 0
    now = 7
    while True:
        cnt += 1
        if now % K == 0:
            print(cnt)
            return
        now = now * 10 + 7
        now %= K


if __name__ == '__main__':
    main()


Measured memory_bytes: 27188
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

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

    string s;
    cin >> s;
    ll n = s.size();
    ll res = 0;
    REP(i, n){
        if(s[i] == 'x') res++;
    }
    if(res >= 8) cout << "NO" << endl;
    else cout << "YES" << endl;
    return 0;
}

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

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    if(a == b && b == c && c == a){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

typedef long long cat;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	string T ="AKIHABARA";
	int id[] ={0,4,6,8};
	vector<string> okS;
	for(int i =0; i < 16; i++) {
		string s;
		vector<int> v(9,1);
		for(int j =0; j < 4; j++)
			if((i>>j)&1) v[id[j]] =0;
		for(int j =0; j < 9; j++) if(v[j]) s +=T[j];
		okS.push_back(s);
	}
	string S;
	cin >> S;
	for(int i =0; i < 16; i++) if(okS[i] == S) {
		cout << "YES\n";
		return 0;
	}
	cout << "NO\n";
	return 0;}

// look at my code
// my code is amazing


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

int main() {
    ll A, B, C;
    cin >> A >> B >> C;
    ll tmp = A+B;
    cout << min(tmp+1, C) + B << endl;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Integer N = sc.nextInt();
		List<Integer> kukuList = new ArrayList<>();
		for (int i = 1; i <= 9; i++) {
			for (int j = 1; j <= 9; j++) {
				kukuList.add(i * j);
			}
		}

		if (kukuList.contains(N)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}

}

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

using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n-1); }


template <class T> ostream& operator<<(ostream& os, const V<T>& v) {
    os << "[";
    for (auto d : v) os << d << ", ";
    return os << "]";
}

template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    return os << "P(" << p.first << ", " << p.second << ")";
}

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

    int n, k;
    cin >> n >> k;
    V<ll> dp(n, TEN(18)); dp[0] = 0;
    V<ll> h(n);
    for (int i = 0; i < n; i++) {
        cin >> h[i];
        for (int j = 1; j <= k; j++) {
            if (i - j < 0) break;
            dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]));
        }
    }
    cout << dp.back() << endl;
    return 0;
}


Measured memory_bytes: 1792
//Love and Freedom.
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define ll long long
#define inf 20021225
using namespace std;

int main()
{
	int n,h,w;
	scanf("%d%d%d",&n,&h,&w);
	printf("%d\n",(n-h+1)*(n-w+1));
	return 0;
}


Measured memory_bytes: 128
# frozen_string_literal: true

def acgt?(str)
  str.chars.all? { |c| %w[A C G T].include?(c) }
end

s = gets.strip

rslt = 0
s.size.times do |i|
  (i..(s.size - 1)).each do |j|
    str = s[i..j]
    rslt = str.size if acgt?(str) && rslt < str.size
  end
end

puts rslt


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

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int p,q,r; cin>>p>>q>>r;
	cout<<min({p+q,q+r,r+p})<<endl;
	return 0;
}


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

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

    ll pena=0,ac=0;
    int n,m;cin>>n>>m;
    vector<bool> check(n,false);
    vector<ll> cnt(n,0);
    rep(i,m){
        int p;cin>>p;p--;
        string s;cin>>s;
        if(s=="AC"){
            if(!check[p]){
                pena+=cnt[p];
                check[p]=true;
                ac++;
            }
        }
        else{
            cnt[p]++;
        }
    }
    cout<<ac<<' '<<pena<<endl;
    return 0;
}


Measured memory_bytes: 1024
#define TEST_MODE true

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rrep2(i, a, b) for (int i = (a)-1; i >= b; --i)
#define range(i, a, b, c) for (int i = a;             \
                               c > 0 ? i < b : i > b; \
                               i += c)
#define chmax(a, b) (a = (a) < (b) ? (b) : (a))
#define chmin(a, b) (a = (a) > (b) ? (b) : (a))
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) begin(a), end(a)
#define ifnot(a) if (not(a))
#define int long long

#ifdef LOCAL_ENV

#if TEST_MODE == true
const bool test = true;
#define dump(x) cerr << #x << " = " << (x) << endl
#else
const bool test = false;
#define dump(x) 
#endif

#else
const bool test = false;
#define dump(x) 
#endif

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
const int INF = (int)1 << 60;
const ll INFL = (ll)1 << 60;
ll mod_n = (int)1e9 + 7;
const double eps = 1e-10;
typedef long double Real;
// return -1, 0, 1
int sgn(const Real &r) { return (r > eps) - (r < -eps); }
int sgn(const Real &a, const Real &b) { return sgn(a - b); }

//.....................
const int MAX = (int)2e5 + 5;

vector<string> split(const string &str, char sep)
{
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while (getline(ss, buffer, sep))
    {
        v.push_back(buffer);
    }
    return v;
}

template <class InputIterator>
int sum(InputIterator begin, InputIterator end)
{
    return accumulate(begin, end, 0ll);
}

void solve();

signed main()
{
    cout << fixed << setprecision(20);
    solve();
    while (true)
    {
        char s[MAX];
        if (scanf("%s", s) == EOF)
            break;
        int n = strlen(s);
        for (int i = n - 1; i > -1; i--)
        {
            ungetc(s[i], stdin);
        }
        solve();
    }
    return 0;
}

string s[3];

void solve() {
	rep(i, 3) cin >> s[i];
	rep(i, 3) cout << (char)toupper(s[i][0]);
	cout << endl;
}


Measured memory_bytes: 256
using System;

namespace ABC065_A_Expired
{
	internal class Program
	{
		public static void Main(string[] args)
		{
			string[] input = Console.ReadLine().Split(' ');
			int x = int.Parse(input[0]);
			int a = int.Parse(input[1]);
			int b = int.Parse(input[2]);

			int eatDay = b - a;
			if(x < eatDay) Console.WriteLine("dangerous");
			else if(eatDay > 0) Console.WriteLine("safe");
			else Console.WriteLine("delicious");
		}
	}
}

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

int main()
{
	int H1, H2, M1, M2, K;
	int answer;

	cin >> H1 >> M1 >> H2 >> M2 >> K;

	answer = 60 * (H2 - H1) + (M2 - M1) - K;
	cout << answer<<endl;

	return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
typedef pair<ii,ll> iii;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define RST(i,n) memset(i,n,sizeof i)
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(),a.end()
#define X first
#define Y second
#define mkp make_pair
#define pb push_back
#define eb emplace_back
#define pob pop_back
#ifdef cold66
#define debug(...) do{\
    fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<", ";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#endif // cold66
//}
template<class T> inline bool chkmax(T &a, const T &b) { return b > a ? a = b, true : false; }
template<class T> inline bool chkmin(T &a, const T &b) { return b < a ? a = b, true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;

const ll MAXn=2e3+5,MAXlg=__lg(MAXn)+2;
const ll MOD=1000000007;
const ll INF=0x3f3f3f3f;

ll C[MAXn][MAXn];
ll add(ll a,ll b){
    ll ret = a+b;
    if (ret >= MOD) ret -= MOD;
    return ret;
}
ll mul(ll a,ll b){
    return (a*b)%MOD;
}
void build(){
    C[0][0] = 1;
    REP1 (i,MAXn-1) {
        REP (j,i+1) {
            C[i][j] = add(C[i-1][j-1],C[i-1][j]);
        }
    }
}
int main(){
    IOS();
    build();
    ll n,k;
    cin >> n >> k;
    ll R = n-k;
    debug(C[4][2]);
    REP1 (i,k) {
        ll ans = mul(C[R+1][i],C[k-1][i-1]);
        cout << ans << endl;
    }
}


Measured memory_bytes: 30208
N, M = map(int,input().split())
a = list(map(int,input().split()))

a_sum = [0 for _ in range(N+1)]
for i in range(N):
  a_sum[i+1] = a_sum[i] + a[i]
  a_sum[i+1] %= M

exist = {}
ans = 0
for i in range(N+1):
  if a_sum[i] in exist:
    ans += exist[a_sum[i]]
    exist[a_sum[i]] += 1
  else:
    exist[a_sum[i]] = 1
    
print(ans)
  
  

Measured memory_bytes: 98832
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int i = 0;
        for (int e = a; e <= b; e++) {
            if (c % e == 0)
                i++;
        }
        System.out.println(i);
    }
}

Measured memory_bytes: 26260
from sys import stdin
def main():
  from builtins import int, map, range
  readline = stdin.readline
  n, q = map(int, readline().split())
  values = [0] * n
  links = [[] for _ in range(n)]
  for _ in range(n - 1):
    a, b = map(int, readline().split())
    links[a - 1].append(b - 1)
    links[b - 1].append(a - 1)
  for _ in range(q):
    p, x = map(int, readline().split())
    values[p - 1] += x
  q = [(0, -1)]
  while q:
    i, p = q.pop()
    for j in links[i]:
      if j == p:
        continue
      values[j] += values[i]
      q.append((j, i))
  print(*values)
main()


Measured memory_bytes: 60392
inli = [-1, 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
n = int(input())
print(inli[n])

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

int n, m, a;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    while (1) {
        cin >> n >> m >> a;
        if (!n & !m & !a) break;
        vector<vector<int>> kuji;
        for (int i = 0; i < m; i++) {
            vector<int> tmp;
            for (int j = 0; j < 3; j++) {
                int k;
                cin >> k;
                tmp.push_back(k);
            }
            kuji.push_back(tmp);
        }
        sort(kuji.begin(), kuji.end(), greater<vector<int>>());

        int ans = a;

        for (auto k : kuji) {
            // cout << k[0] << k[1] << k[2] << endl;
            if (k[1] == ans) {
                ans = k[2];
            } else if (k[2] == ans) {
                ans = k[1];
            }
        }
        cout << ans << endl;
        // for (auto i : kuji) {
        //     for (auto j : i) {
        //         cout << j << " ";
        //     }
        //     cout << endl;
        // }
    }
}


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

grid = []
ans = []

for i in range(2):
    grid.append(list(map(int, input().split())))

for i in range(n):
    anst = 0
    for _ in range(n):
        anst = sum(grid[0][:i+1])
        anst += sum(grid[1][i:n])
    ans.append(anst)

print(max(ans))


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

int main()
{
	int n;
	cin >> n;
	long long sum = 0, min = 999999999, max = -999999999;
	int a;
	for (int i = 0; i < n; i++)
	{
		cin >> a;
		sum = sum + a;

		if (a < min)
			min = a;
		if (a > max)
			max = a;
	}
	cout << min << " " << max << " " << sum << endl;
}


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

int main()
{
    int h, a;
    cin >> h >> a;

    int frag = 1;
    int count = 0;
    while (frag)
    {
        count += 1;
        h = h - a;

        if (h <= 0)
        {
            frag = 0;
        }
    }

    cout << count << endl;
}


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

int main(){
  int H,W;
  cin >>H>>W;
  char a[H][W];
  bool letu[W];
  bool gyou[H];
  for (int i=0;i<W;i++){
    letu[i]=0;
  }
  for (int i=0;i<H;i++){
    gyou[i]=0;
  }
  
  for (int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      cin>>a[i][j];
      if (a[i][j]=='#'){
        letu[j]=1;
        gyou[i]=1;
      }
    }
  }
  
  for (int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if((letu[j]==1)&&(gyou[i]==1)){
        cout<<a[i][j];
      }
    }
    if (gyou[i]==1){
      cout<<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;
 cin >> n;
 vector<int> a(n);
 rep(i, n) {
   cin >> a[i];
 }
 int cnt = 0;
 for(int i = 0; i < n; i++){
   if(i % 2 != 0) continue;
   if(a[i] % 2 != 0) cnt++;
 }
 cout << cnt << endl;
}


Measured memory_bytes: 3616
// template.cpp {{{
#include <bits/stdc++.h>
using namespace std;

using lint = long long;
#define reps(i, a, n) for (lint i = (a); i < (lint)(n); ++i)
#define rep(i, n) reps(i, 0, n)
struct pre_{pre_(){cin.tie(0);ios::sync_with_stdio(0);}} pre__;
// }}}

#define fi first
#define se second

signed main() {
  pair<int, int> p[6];
  rep(i, 6) cin >> p[i].fi >> p[i].se;
  rep(i, 6) {
    if (p[i].fi > p[i].se) {
      swap(p[i].fi, p[i].se);
    }
  }
  sort(p, p + 6);

  if (p[0] != p[1] || p[2] != p[3] || p[4] != p[5]) {
    cout << "no" << endl;
  } else if (p[0].fi != p[2].fi || p[0].se != p[4].fi) {
    cout << "no" << endl;
  } else if (p[2].se != p[4].se) {
    cout << "no" << endl;
  } else {
    cout << "yes" << endl;
  }
}

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

#define REP(i, n) for(int i = 0; i != n; ++i)
#define REPR(i, n) for(int i = n - 1; i != -1; --i)
#define FOR(i, a, b) for(int i = a; i != b; ++i)
#define RBF(i, n) for(auto &i : n)
#define ABS(n) (n < 0 ? -n : n)
#define MIN(a, b) (a < b ? a : b)
#define MAX(a, b) (a > b ? a : b)
#define IN(n) (cin >> n)
#define OUT(n) (cout << n << "\n")
#define INF 1e9
#define ALL(v) (v.begin(), v.end())
#define V vector<int>

using namespace std;
using ll = long long;

int main() {
    int N;
    IN(N);
    map<int, int> m;
    int i, a, max_a = 0;
    for(i = 0; i < N; i++) {
        IN(a);
        if(max_a < a) max_a = a;
        m[a]++;
    }
    vector<int> wa;

    for(i = 0; i <= max_a; i++) {
        if(i == 0) {
            wa.push_back(m[i] + m[i+1]);
        }
        else if(i == max_a) {
            wa.push_back(m[i-1] + m[i]);
        }
        else wa.push_back(m[i-1] + m[i] + m[i+1]);
    }

    int max = 0;
    for(i = 0; i <= max_a; i++) {
        if(max < wa[i]) max = wa[i];
    }

    OUT(max);
}

Measured memory_bytes: 5368
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
#define reps(i,s,n) for(ll (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define reptr(i,n) for(ll (i)=(n);(i)>=0;--(i))
#define All(x) (x).begin(),(x).end()
#define Rall(a) (a).rbegin(), (a).rend()
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>
#define mp make_pair
#define pb push_back
const ll MOD=1e9+7;
const ll INF=1e10+1;
using namespace std;
#define NOT_EXIST -1

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

signed main(){
	ll n;
	cin >> n;
	cout << (n-2)*180 << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll maxn=2e5+1;
const ll INF=4e18;
ll pen[maxn];
void solve()
{
	ll N,M;
	cin>>N>>M;
	memset(pen,0,sizeof(pen));
	set<ll> ac;
	ll pena=0;
	for(ll i=0;i<M;i++)
	{
		ll p;
		string res;
		cin>>p>>res;
		if(!ac.count(p))
		{
			if(res=="AC")
			{
				pena+=pen[p];
				ac.insert(p);
			}
			else
			{
				pen[p]++;
			}
		}
	}
	ll ca=ac.size();
	cout<<ca<<" "<<pena<<"\n";
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll T=1,p=0;
	//cin>>T;
	do
	{
		solve();
		p++;
	}while(p<T);
	return 0;
}



Measured memory_bytes: 6528
#include <algorithm>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>

using Graph = std::vector<std::vector<int>>;
using WGraph = std::vector<std::vector<std::pair<int, long long>>>;
using ll = long long;
using namespace std;

long long dijkstra(WGraph G, int s, int t) {
    int n = (int)G.size();
    std::vector<long long> dis(n, 1e16);
    dis.at(s) = 0;
    using P = std::pair<long long, int>;
    std::priority_queue<P, std::vector<P>, std::greater<P>> que;
    que.push(std::make_pair(0, s));

    while (!que.empty()) {
        auto p = que.top();
        que.pop();
        int v = p.second;
        if (dis.at(v) < p.first) {
            continue;
        }
        for (auto e : G.at(v)) {
            if (dis.at(e.first) > dis.at(v) + e.second) {
                dis.at(e.first) = dis.at(v) + e.second;
                que.push(std::make_pair(dis.at(e.first), e.first));
            }
        }
    }
    return dis.at(t) == 1e16 ? -1 : dis.at(t);
}

int main () {
    int n = 0, m = 0;
    cin >> n >> m;
    int a = 0, b = 0, tmp = 0, two = 0, to = 0;
    int len = (int)pow(2, n);
    WGraph G(len);
    for (int i=0; i<m; i++) {
        cin >> a >> b;
        two = 0;
        for (int j=0; j<b; j++) {
            cin >> tmp;
            tmp--;
            two += (int)pow(2, tmp);
        }
        for (int j=0; j<len; j++) {
            to = (j | two);
            if (to != j) {
                G.at(j).push_back(make_pair(to, a));
            }
        }
    }
    cout << dijkstra(G, 0, len-1) << endl;
    return 0;
}


Measured memory_bytes: 130176
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        Long A = Long.valueOf(s.next());
        Long B = Long.valueOf(s.next());
        Long C = Long.valueOf(s.next());
        Long K = Long.valueOf(s.next());
      
      	if(K - A - B > 0) {
         System.out.println(A + (K - A - B) * (-1)); 
        }else if(K > A){
         System.out.println(A);
        }else {
         System.out.println(K); 
        }
    }
}

Measured memory_bytes: 35700
#include<iostream>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<set>
#include<queue>
#include<list>
#include<stdio.h>
#include<stdlib.h>
#include<map>
#include<cstdio>
#include <iomanip>

#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()

using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

int main() {

	const int inf = 100000000;

	int n, m;
	cin >> n >> m;

	int a[1000], b[1000], c[1000], dist[100][100];

	//入力を受け取る
	//0-オリジンのため-1
	for (int i = 0; i < m; i++) {
		cin >> a[i] >> b[i] >> c[i];
		a[i]--, b[i]--;
	}

	//距離用の配列の初期化
	//自己辺は無いのでi=jは0
	//それ以外は未到達にしておく。
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if (i == j) {
				dist[i][j] = 0;
			}
			else {
				dist[i][j] = inf;
			}
		}
	}	

	//隣接している頂点i-jに辺を張る
	//今記録されている値よりも、直接いったほうが近ければ辺を貼りなおす。
	for (int i = 0; i < m; i++) {
		dist[a[i]][b[i]] = c[i];
		dist[b[i]][a[i]] = c[i];
	}

	//WFで任意の2点間の最短距離を格納していく。
	for (int k = 0; k < n; ++k) {
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
			}
		}
	}

	int ans = m;
	//辺を一つ一つみていって、最短距離＋直接つないだ距離＝最短距離になっているか
	//調べる

	//始点iを一つ選んでくる。
	for (int i = 0; i < m; i++) {
		bool shortest = false;
		//終点jに対して
		for (int j = 0; j < n; j++)if (dist[j][a[i]] + c[i] == dist[j][b[i]])shortest = true;
		if (shortest == true) {
			ans--;
		}
	}

	cout << ans << endl;

	return 0;
}


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

typedef long long ll;
typedef pair<int,int> pii;

long long MOD = 1000000000 + 7;
long long MAX = 1000000000000000000;
// modint
const ll mod = 1e9+7;
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.inv();
    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 inv() 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 mint = ModInt<mod>;

int main(){
  cout << setprecision(10);

  ll N, K;
  cin >> N >> K;

  map<ll, mint> m;
  vector<mint> v(K+1);
  mint ans = 0;
  for(ll i = K; i >= 1; i--){
    mint tmp = K / i; // Kまでに含まれるiの倍数の数
    tmp = tmp.pow(N); // 倍数のどれかの組み合わせ

    for(ll j = 2; i * j <= K; j++){
      tmp -= v[i*j];
    }
    v[i] = tmp;
    ans += tmp * (mint) i;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3756
#include<bits/stdc++.h>
using namespace std;
static auto x = []() {
    std::ios::sync_with_stdio(false); // turn off sync
    cin.tie(nullptr);                 // untie in/out streams
    return 0;
}();
bool check(int x)
{
    for (int i = 2; i * i <= x; i++) if (x % i == 0) return true;
    return false;
}
int main()
{
    int x;
    cin >> x;
    while (check(x)) x++;
    cout << x;
}

Measured memory_bytes: 256
def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
# from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx as nx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop
a,b=n1()
# from math import gcd
from fractions import gcd
m=gcd(a,b)

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

gcd_list=make_divisors(m)
if len(gcd_list)==1:
    print(1)
else:
    prime=[]
    for i in gcd_list[1:]:
        for j in prime:
            if i%j==0:
                break
        else:
            prime.append(i)
    print(len(prime)+1)

Measured memory_bytes: 5288
N, Q = gets.split.map(&:to_i)
S = gets.chomp
sum = Array.new(N+1, 0)
N.times do |i|
    sum[i] += sum[i-1]
    if S[i, 2] == 'AC'
        sum[i] += 1
    end
end
Q.times do
    l, r = gets.split.map(&:to_i)
    l -= 1
    r -= 1
    puts sum[r-1] - sum[l-1]
end

Measured memory_bytes: 3324