akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define pll pair<ll,ll>
#define pint pll
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
  int n;
  cin >> n;
  ll a[n];
  rep(i,n)cin >> a[i];
  rep(i,n){
    if(a[i]%2==0 && (a[i]%3!=0 && a[i]%5!=0)){
      cout << "DENIED" << endl;
      return 0;
    }
  }
  cout << "APPROVED" << endl;
return 0;}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repp(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define rrep(i, n, m) for (int i = n; i >= m; i--)
#define p(a,b) printf(a,b);
#define o(s) cout<< s << endl;
typedef long long LL;
template <class T>
bool contain(const std::string &s, const T &v)
{
    return s.find(v) != std::string::npos;
}

int main()
{
    int cnt=0;
    string s, s1 = "CODEFESTIVAL2016";
    cin >> s;
    rep(i,16){
        if(s[i]!=s1[i])cnt++;
    }
    o(cnt);
}


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

typedef pair<int,int> P;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define sz(x) ((int)(x).size())
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

int main()
{
    int n,m,x;cin >> n >> m >> x;
    vector<vector<int> > books(n, vector<int>(m));
    vector<int> c(n);
    rep(i,n)
    {
        cin >> c[i];
        rep(j,m)cin >> books[i][j];
    }
    
    int counter = 1<<n;
    int mn = INF;
    int flag = 0;
    rep(i,counter)
    {
        int price = 0;
        vector<int> skills(m);
        rep(i, m) skills[i] = 0;
        rep(j,n)
        {
            if(i & (1<<j))
            {
                price += c[j];
                rep(k,m)
                {
                    skills[k] += books[j][k];
                }
            }
        }
        bool result = true;
        rep(l,m)
        {
            if(skills[l]<x)
            {
                result = false;
                break;
            }
        }
        if(result)
        {
            mn = min(mn, price);
            flag = 1;
        }
    }
    if(flag == 0)
    {
        cout << -1 << endl;
        return 0;
    }
    cout << mn << endl;
}

Measured memory_bytes: 3628
N, M = map(int,input().split())
students = []
checkpoints = []
for i in range(N):
    x,y = map(int,input().split())
    students.append([x,y])
for i in range(M):
    x,y = map(int,input().split())
    checkpoints.append([x,y])
ans = []
for i in range(N):
    ans_tmp = [1000000000,-1]
    for q in range(M):
        dist = abs(students[i][0]-checkpoints[q][0]) + abs(students[i][1]-checkpoints[q][1])
        if dist < ans_tmp[0]:
            ans_tmp[0] = dist
            ans_tmp[1] = q
    ans.append(ans_tmp[1]+1)
for k in ans:
    print(k)

Measured memory_bytes: 3064
#include<stdio.h>
int main(void){
    while(1){
        char top, c[200]={0};
        int i, n, alp[26]={0}, first=0, sec=0;
        scanf("%d",&n);
        getchar();
        if(n==0) break;
        for(i=0;i<n;i++){
            scanf("%c",&c[i]);
            getchar();
        }
        for(i=0; i<n; i++){
            alp[c[i]-'A']++;
            if(alp[c[i]-'A'] > first){
                top=c[i];
                first=alp[c[i]-'A'];
            }
            else if(alp[c[i]-'A'] > sec){
                sec=alp[c[i]-'A'];
            }
            if(first-sec > n-i-1){
                break;
            }
        }
        if(first==sec){printf("TIE\n");}
        else{
            printf("%c %d\n",top,i+1);
        }
    }
    return 0;
}



Measured memory_bytes: 2104
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using i128 = boost::multiprecision::int128_t;
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using VVbo = vector<Vbo>;
using VVV = vector<VV>;
using VVVll = vector<VVll>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
#define rep2(i, m, n) for(int i=int(m); i<int(n); ++i)
#define drep2(i, m, n) for(int i=int(m)-1; i>=int(n); --i)
#define rep(i, n) rep2(i, 0, n)
#define drep(i, n) drep2(i, n, 0)
#define all(a) a.begin(), a.end()
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << " "; return os; }
template<typename T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r)
inline int Log2(ll x) { int k; for (k = 0; x > 0; ++k) x >>= 1; return k; } // number of binary digits
const int INF  = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS   = 1e-10;
const ld PI    = acos(-1.0);
const int MOD  = int(1e9)+7;
// const int MOD  = 998244353;


int main() {
  string s; cin >> s;
  int K; cin >> K;
  int n = s.size();

  VVV dp(K+2, VV(n+1, V(n+1)));

  rep(k, K+1) rep(i, n) rep(j, n) {
    chmax(dp[k][i+1][j+1], dp[k][i+1][j]);
    chmax(dp[k][i+1][j+1], dp[k][i][j+1]);
    chmax(dp[k][i+1][j+1], dp[k][i][j] + (s[i] == s[n-1-j]));
    chmax(dp[k+1][i+1][j+1], dp[k][i+1][j]);
    chmax(dp[k+1][i+1][j+1], dp[k][i][j+1]);
    chmax(dp[k+1][i+1][j+1], dp[k][i][j] + 1);
  }
  int ans = 0;
  rep(i, n+1) chmax(ans, dp[K][i][n-i]*2);
  rep(i, n) chmax(ans, dp[K][i+1][n-i]*2-1);
  cout << ans << "\n";
  return 0;
}


Measured memory_bytes: 113628
import std.algorithm;
import std.container;
import std.conv;
import std.functional;
import std.math;
import std.meta;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.traits;
import std.typecons;


void solve(ref long a, ref long b, ref long c, ref long d, ref long e, ref long k){
  if (e - a <= k) {
    writeln("Yay!");
  } else {
    writeln(":(");
  }
}

// Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long a;
    readf(" %d", &a);
    long b;
    readf(" %d", &b);
    long c;
    readf(" %d", &c);
    long d;
    readf(" %d", &d);
    long e;
    readf(" %d", &e);
    long k;
    readf(" %d", &k);
    solve(a, b, c, d, e, k);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#define ll long long
#define faltu ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define inf 1000000007
#define mod 1000000007
#define pi pair<int,int>
#define lpi pair<int,int>
#define mp make_pair
#define pb push_back
#define vi vector<int>
#define lvi vector<long long int>
#define pie 3.14159265358979323846
using namespace std;
int main()
{
	faltu;
	int n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	for(int i=0;i<n;i++)
	{
		if(i==k-1)
		{
			char c=int(s[i])+32;
			cout<<c;
		}
		else cout<<s[i];
	}
cout<<endl;
}




Measured memory_bytes: 256
#include <iostream>
#include<bits/stdc++.h>
#define ll long long
#define   ull unsigned long long 
const int MAX=1e6+9;
const int mod=1e9+7;
using namespace std;
int cnt[MAX];

int main(){
	int n ,k;
	cin>>n>>k;
	string s;
	cin>>s;
	int l=0 , cnt=0;
	int mx=1;
	for(int i=0;i<s.size();i++){
		if(s[i]==s[i-1]&&s[i]=='0')
			continue;
		if(s[i]=='0')
			cnt++;
		while(cnt>k&&l<i){
			if(s[l]=='0'){
					while(s[l]=='0')
						l++;
				cnt--;
			}
			else
				l++;
		}
		//cout<<i<<"\n";
		if(mx<(i-l+1))
			mx=i-l+1;
	}
	if(mx<(n-1-l+1))
		mx=n-1-l+1;
	cout<<mx;
	
}

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

int main()
{
        int A,B,K;
        cin >> A >> B >> K;
        for(int i=0;i<K;i++){
                if(A+i<=B){
                        cout << A+i << "\n";
                }else{
                        break;
                }
        }
        if(A+K-1<B+1-K){
                for(int i=0;i<K;i++){
                        cout << B+1-K+i << "\n";
                }
        }else if(A+K-1<B){
                for(int i=A+K;i<=B;i++){
                        cout << i << "\n";
                }
        }
}


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

int main() {

	int n,i; cin>>n;
	for(i=1;i<10;i++) {
		if(n%i==0) { if((n/i)<10) {
			cout<<"Yes"<<endl; break; }
		}
	}
	if(i==10) cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys


def solve(K: int):
    print(''.join(['ACL'] * K))
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    solve(K)

if __name__ == '__main__':
    main()


Measured memory_bytes: 61584
#include "bits/stdc++.h"
using namespace std;
#define INF 1e9
#define rep(i, n) for(int i = 0; i < n; i++)
#define ALL(x) (x).begin(), (x).end()  //昇順
#define RALL(x) (x).rbegin(), (x).rend() // 降順
const long long mod = 1e9+7;
typedef priority_queue<int> PQ;
typedef vector<long long> VL;
typedef vector<int> VI;  // VI a(n);
typedef vector<string> VS;  
typedef vector<char> VC; 
typedef vector<VS> VSS;
typedef vector<VC> VCC;    
typedef vector<VI> VVI;   // VVI a(n,vector<int>(m)) n * m 
typedef vector<VL> VVL;
typedef pair<int, int> PII;
typedef map<int, int> MP;   //MP a;
typedef vector<pair<int, int> > PS;
typedef long long ll;  //ll とdoubleは違う
template <class T>  // chmax(max, a);
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> //chmin(min,a)
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
template<typename T>   // operator << (cout,a);
ostream& operator << (ostream& os, vector<T>& v) {
    os << "{";
    rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); }
    os << "}";
    return os;
}

ll max=-1000000000,min=1e9+1;

int main(){
    ll x=0,y=0,n,m,h,k,w,sum=0,sum2=0;
    string s;
    cin >> n;
    cout << 3*pow(n,2) << endl;
    return 0;
}

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

int main() {
  int A, B;
  string S, result = "Yes";
  
  cin >> A >> B >> S;
  int i = 0;
  
  if (S.size() > A + B + 1) {
    result = "No";
    cout << result << endl;
    return 0;
  }
  
  for (char c : S) {
    if (i == A && c != '-') {
      result = "No";
      break;
    }
    if (i != A && c == '-') {
      result = "No";
      break;
    }
    i++;
  }
  cout << result << endl;
}

Measured memory_bytes: 256
N = int(input())
V = list(map(int,input().split()))
even = [0] * (10 ** 5 + 10)
odd = [0] * (10 ** 5 + 10)
for v in V[1::2]:
  even[v] += 1
for v in V[::2]:
  odd[v] += 1
max_even = max(even)
max_odd = max(odd)
if(even.index(max_even) != odd.index(max_odd)):
  print(N - max_even - max_odd)
else:
  even.sort(reverse = True)
  odd.sort(reverse = True)
  print(min(N - even[0] - odd[1], N - even[1] - odd[0]))

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

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

    int X;
    cin >> X;


    for(int i=max(X-K+1,-1000000); i<X+K && i<1000000; i++){
       cout << i << " ";
    }

    cout << endl;

}

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

int main(){
    int A,B;
    cin >> A >> B;
    if((A + B) % 2 == 0){
        cout << (A + B) / 2 << endl;
    }else{
        cout << "IMPOSSIBLE" << endl;
    }
}

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

S = set()
cnt = 0
for i in range(1000):
    i = str(i).zfill(3)
    num = 0
    for j in range(n):
        if L[j] == i[0] and num == 0:
            num =1
        elif L[j] == i[1] and num == 1:
            num =2
        elif L[j] == i[2] and num == 2:
            S.add(i)
            
print(len(S))

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

int main()
{
    string s;
    cin >> s;
    char now = s.at(0);
    int i;
    int ans = 0;
    for(i = 1;i < s.size();++i){
        if(now != s.at(i)){
            now = s.at(i);
            ++ans;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int> p(n);
    for(int i=0;i<n;i++) cin>>p[i];

    int cnt=0;
    vector<bool> mark(n);
    for(int i=0;i<n;i++){
        if(p[i]-1 == i){
            cnt++;
            mark[i]=true;
        }else{
            mark[i]=false;
        }
    }

    int ans = cnt;
    for(int i=0;i<n-1;i++){
        if(mark[i] && mark[i+1]){
            ans--;
            i++;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 640
#include <cstdio>
#include <cmath>

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define inc( i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec( i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

template<typename T> void swap(T & x, T & y) { T t = x; x = y; y = t; return; }
template<typename T> T abs(T x) { return (0 <= x ? x : -x); }
template<typename T> T max(T a, T b) { return (b <= a ? a : b); }
template<typename T> T min(T a, T b) { return (a <= b ? a : b); }
template<typename T> bool setmin(T & a, T b) { if(a <= b) { return false; } else { a = b; return true; } }
template<typename T> bool setmax(T & a, T b) { if(b <= a) { return false; } else { a = b; return true; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

int len(char s[]) {
	int l = 0;
	while(s[l] != '\0') { l++; }
	return l;
}
int bitlen(int x) {
	int c = 0;
	while(x != 0) { c++; x /= 2; }
	return c;
}
int bc(int x) {
	int c = 0;
	while(x != 0) {	c += x % 2; x /= 2; }
	return c;
}
LL fact(LL x) {
	if(x == 0) { return 1; }
	return x * fact(x - 1);
}
LL _fibo[50];
bool fibo_flag;
LL fibo(int x) {
	if(fibo_flag) { return _fibo[x]; }
	_fibo[0] = 0;
	_fibo[1] = 1;
	incII(i, 2, x) { _fibo[i] = _fibo[i - 1] + _fibo[i - 2]; }
	fibo_flag = true;
	return _fibo[x];
}


int n, a[100], ans;
int h, w, b[100][100];
char s[101];
const int MOD = 1000000007;


int mainN() {
	scanf("%d", &n);
	inc(i, n) { scanf("%d", &a[i]); }
	
	printf("%d\n", n);
	
	return 0;
}

int mainS() {
	scanf("%s", s);
	inc(i, len(s)) {
		if(s[i] == '#') {
			ans++;
		}
	}
	
	printf("%d", ans);
	
	return 0;
}


char snu[6] = "snuke";
char t[26][26][6];

int main() {
	scanf("%d%d", &h, &w);
	inc(i, h) {
	inc(j, w) {
		scanf("%s", t[i][j]);
	}
	}
	
	inc(i, h) {
	inc(j, w) {
		bool flag = true;
		inc(k, 5) { if(snu[k] != t[i][j][k]) { flag = false; break; } }
		if(flag) { printf("%c%d\n", 'A' + j, i + 1); }
	}
	}
	
	return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define endl '\n'
const int inf = 1000000007;
const ll INF = 1e18;
int mod = 998244353;
// int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template<typename T, typename U> T pow_(T a, U b) { return b ? pow_(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { a += b % mod; if (a >= mod) a -= mod; }
template<class T> void operator += (vector<T>& v, vector<T> v2) { rep(i, sz(v2)) v.eb(v2[i]); }

void solve();

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(11);
  int T;
  T = 1;
  while (T--) solve();
}

void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  cin >> a;
  double ans = 0;
  rep(i, n) ans += 1.0 / a[i];
  cout << 1.0 / ans << endl;
}


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

using ll = long long;
using ull = unsigned long long;
using st = string;
using db = double;
using vll = vector<long long>;
using vdb = vector<db>;
using vvll = vector<vll>;
using vst = vector<st>;
using vchar = vector<char>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
#define rep(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define vrep(i, vec) for(auto& i : vec)
#define vin(vec) for(auto& i : vec) cin >> i
#define all(v) v.begin(), v.end()
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;}
const ll mod = 1000000007;
const ll inf = 1LL << 60;


int main(){
  db r;
  cin >> r;
  cout << fixed << setprecision(3);
  cout << r * 3.141592 * 2 << endl;
}


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

int main()
{
  int n;
  int a[100];
  int mn = 101, mx = -101;

  cin >> n;
  for (int i = 0; i < n; i++){
    cin >> a[i];
    mn = min(mn, a[i]);
    mx = max(mx, a[i]);
  }
  int x;
  int ans = 100000000;
  for (int i = mn; i <= mx; i++){
    int t = 0;
    for (int j = 0; j < n; j++){
      t += (a[j] - i) * (a[j] - i);
    }
    ans = min(ans, t);
  }
  cout << ans << endl;

  return (0);
}

Measured memory_bytes: 256
require 'prime'

MAX = 10 ** 6
n = gets.to_i
a_n = gets.split.map(&:to_i)

# 全GCDが1でない場合どちらでもない
if a_n.inject {|all, a| all.gcd(a) } > 1
    puts "not coprime"; exit 0
end

## ============
## 以下は全GCDは常に1前提
## ============

memo = Array.new(MAX + 1, 0)
primes = Array.new(MAX + 1, 0)
Prime.each(MAX) {|i| primes[i] = 1 }

a_n.each do |a|
    # 素数はすでに計算済みなので素因数分解を省略
    if primes[a] == 1
        if memo[a] == 1
            puts "setwise coprime"; exit 0
        end

        memo[a] = 1
    else
        Prime.prime_division(a).each do |x, cnt|
            if memo[x] == 1
                puts "setwise coprime"; exit 0
            end
            memo[x] = 1
        end
    end
end

puts "pairwise coprime"


Measured memory_bytes: 97016
#include<stdio.h>

int x_price(int a,int p){ 
    return p*a;
}

int y_price(int b,int c,int d,int p){ 
    if(c>=p){
        return b;
    }else if(c<p){
        return b+(p-c)*d;
    }   
}

int  main(){
    int a,b,c,d,p,x,y,ans;

    while(scanf("%d",&a)!=EOF){
        scanf("%d%d%d%d",&b,&c,&d,&p);
        x=x_price(a,p);
        y=y_price(b,c,d,p);
        ans=x<y?y:x;
        printf("%d\n",(x=x_price(a,p))<(y=y_price(b,c,d,p))?x:y);
    }   
    return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF (1e9)

int partition(int A[], int p, int r) {
  int x = A[r];
  int i = p - 1;
  for(int j = p; j < r; j++) {
    if(A[j] <= x) {
      i++;
      int tmp = A[i]; A[i] = A[j]; A[j] = tmp;
    }
  }
  int tmp = A[i+1]; A[i+1] = A[r]; A[r] = tmp;
  return i+1;
}



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

  int q = partition(A, 0, n-1);

  for(int i = 0; i < q; i++) cout << A[i] << " ";
  cout << "[" << A[q] << "]";
  for(int i = q+1; i < n; i++) cout << " " << A[i];
  cout << endl;

  return 0;
}


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

vector<int> G[200005];
int aoki_d[200005], takahashi_d[200005];
bool is_end[200005];

void dfs(int u, bool is_aoki, int p=-1) {
  for (int v : G[u]) {
    if (v == p) continue;
    if (is_aoki) aoki_d[v] = aoki_d[u] + 1;
    else takahashi_d[v] = takahashi_d[u] + 1;
    dfs(v, is_aoki, u);
  }
  is_end[u] = G[u].size() == 1;
}

int main() {
  int n, u, v;
  cin >> n >> u >> v;
  --u; --v;
  rep(i, n-1) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(u, false);
  dfs(v, true);
  int ans = 0;
  rep(i, n) {
    if (takahashi_d[i] <= aoki_d[i] && !is_end[i]) {
      ans = max(ans, aoki_d[i]);
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 19892
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>

using namespace std;

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

using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int diff[4][2] = {
	{ 0, -1 },
	{ -1, 0 },
	{ 1, 0 },
	{ 0, 1 },
};


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

    int h, w;
    cin >> h >> w;

    int maze[22][22] = {{}};
    int cnt = 0;
    for (int i = 1; i <= h; i++)
    {
        string tmp;
        cin >> tmp;
        for (int j = 1; j <= w; j++)
        {
            if (tmp[j-1] == '.') {
                maze[i][j] = 1;
                cnt++;
            } else {
                maze[i][j] = 2;
            }
        }
    }

    // for (int i = 1; i <= h; i++)
    // {
    //     for (int j = 1; j <= w; j++)
    //     {
    //         cout << maze[i][j] << " ";
    //     }
    //     cout << "\n";
    // }

    int V = (w+1)*(h+1);
    //隣接行列G
    //G[i][j]･･･頂点iから頂点jに行くまでの最短コスト
    vector<vector<int>> G(V, vector<int>(V, inf));
    for (int i = 1; i <= h; i++)
    {
        for (int j = 1; j <= w; j++) {
            if (maze[i][j] == 1) {
                for (int k = 0; k < 4; k++)
                {
                    if (maze[i+diff[k][0]][j+diff[k][1]] == 1) {
                        G[(i-1)*w+j][((i-1)+diff[k][0])*w+j+diff[k][1]] = 1;
                        G[((i-1)+diff[k][0])*w+j+diff[k][1]][(i-1)*w+j] = 1;
                    }
                }
                
            } 
        }
    }

    // for (int i = 0; i < V; i++)
    // {
    //     for (int j = 0; j < V; j++) {
    //         cout << G[i][j] << " ";
    //     }
    //     cout << "\n";
    // }
    //ワーシャルフロイド法
    for (int k = 0; k < V; k++) {
        for (int i = 0; i < V; i++) {
            for (int j = 0; j < V; j++) {
                G[i][j] = min(G[i][j], G[i][k] + G[k][j]);
            }
        }
    }
    int ans = 0;
    for (int i = 0; i < V; i++)
    {
        for (int j = 0; j < V; j++) {
            if (G[i][j] < inf) {
                ans = max(ans, G[i][j]);
            }
        }
    }
    if (cnt == 2 && ans == 2) {
        cout << 1 << "\n";
    } else {
        cout << ans << "\n";
    }
    
}

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

int main() {
  int A,B,C;
  cin >> A >> B >> C ;
  
  if(A==B&&B==C) {
    cout << "No" << endl;
  }
  
  else if(A!=B && B!=C && C!=A) {
    cout << "No" << endl;
  }
  
  else {
    cout << "Yes" << endl;
  }
}

    
    
    

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

typedef long long ll;
const ll MOD = 1000000007;

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<ll> d(n), m(n);
    for (int i = 0; i < n; i++) cin >> d[i];
    m[0] = 0;
    for (int i = 0; i < 2 * n; i += 2) {
        m[(i + 2) % n] = 2 * (d[(i + 1) % n] - d[i % n]) + m[i % n];
    }
    //debug
    // for (int i = 0; i < n; i++) {
    //     cout << m[i] << " ";
    // }
    // cout << endl;
    ll diff = (m[0] + m[1]) / 2 - d[0];
    for (int i = 0; i < n; i++) {
        cout << m[i] - diff << " ";
    }
    return 0;
}

Measured memory_bytes: 2944
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for i in range(A + 1):
  for j in range(B + 1):
    for k in range(C + 1):
      if X == 500 * i + 100 * j + 50 * k:
        count += 1
print(count)

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

using namespace std;
using ll = long long;

const int INF = 1e9;
const double PI = acos(-1.0);
const ll MOD = 1e9 + 7;

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define debug(x) cout << #x << ": " << x << endl;
#define popcnt __builtin_popcount


int main() {
    int N; cin>>N;
    vector<int> T(N), A(N), patT(N), patA(N);
    for (int i = 0; i < N; i++) cin>>T[i];
    for (int i = 0; i < N; i++) cin>>A[i];
    if(T[N-1]!=A[0]){
        cout<<0<<endl;
        return 0;
    }

    patT[0]=1; patA[N-1]=1;
    int nowmxT=T[0], nowmxA=A[N-1];

    for(int i = 1; i < N; i++)
    {
        if(nowmxT==T[i]){
            patT[i]=nowmxT;
        }else if(nowmxT<T[i]){
            nowmxT=T[i];
            patT[i]=1;
            if(A[i]<T[i]){
                cout<<0<<endl;
                return 0;
            }
        }
    }

    for(int i = N-2; i >= 0; i--)
    {
        if(nowmxA==A[i]){
            patA[i]=nowmxA;
        }else if(nowmxA<A[i]){
            nowmxA=A[i];
            patA[i]=1;
            if(A[i]>T[i]){
                cout<<0<<endl;
                return 0;
            }
        }
    }
    
    ll res = 1LL;
    for(int i = 0; i < N; i++)
    {
        res*=(ll)min(patT[i], patA[i]);
        res%=MOD;
    }
    cout<<res<<endl;

    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
using ll = long long;
using graph = std::vector<std::vector<ll>>;

using namespace std;

int main() {
    ll H,W,N;
    cin >> H >> W >> N;
    ll sy,sx;
    cin >> sy >> sx;
    string S,T;
    cin >> S >> T;
    ll upperEdge = 1;
    ll bottomEdge = H;
    ll rightEdge = W;
    ll leftEdge = 1;

    for(int i = N - 1; i >= 0; i--){
        char tak = S[i];
        char ao = T[i];
        switch(ao){
            case 'L':
                rightEdge = min(rightEdge + 1,W);
                break;
            case 'R':
                leftEdge = max(leftEdge - 1,1ll);
                break;
            case 'D':
                upperEdge = max(upperEdge - 1,1ll);
                break;
            case 'U':
                bottomEdge = min(bottomEdge + 1,H);
                break;
        }
        switch(tak){
            case 'R':
                rightEdge = rightEdge - 1;
                break;
            case 'L':
                leftEdge = leftEdge + 1;
                break;
            case 'U':
                upperEdge = upperEdge + 1;
                break;
            case 'D':
                bottomEdge = bottomEdge - 1;
                break;
        }
        //cout << leftEdge << " " << rightEdge << " " << upperEdge << " " << bottomEdge << endl;
        if(leftEdge > rightEdge || upperEdge > bottomEdge){
            cout << "NO" << endl;
            return 0;
        }
    }
    if(leftEdge <= sx && sx <= rightEdge && upperEdge <= sy && sy <= bottomEdge){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
}


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

# F(A*B) = F(B*A) なのでnの半分の数までの繰り返しで良い
a = int(n**0.5)

# n/2を割り切れる最大の数を探す
while n % a != 0:
      a -= 1
# a*b=n より
b = n//a
# 大きい数の文字数を返せば良い
print(len(str(max(a,b))))

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
  	cin>>s;
  int c=0,ans=0;	
  for(int i=0;i<s.size();i++){
  	if(s[i]=='R')
      c++;
    else{
      ans=max(c,ans);
      c=0;
    }
  }
  cout<<max(ans,c)<<endl;
}

Measured memory_bytes: 3620
#![allow(unused_imports)]
#![allow(non_snake_case)]
#[allow(unused_macros)]
macro_rules! input_byline {
    ($($r:tt)* ) => {
        let stdin = std::io::stdin();
        let mut q = std::collections::VecDeque::new();
        let mut next = || {
            if q.is_empty() {
                let mut s = String::new();
                stdin.read_line(&mut s);
                for v in s.split_whitespace() {
                    q.push_back(v.to_string());
                }
            }
            q.pop_front().unwrap()
        };
        input_inner!{next, $($r)*}
    };
}
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };
    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

use std::cmp::{max, min};
use std::collections::{BinaryHeap, HashMap};
 
type Graph = Vec<Vec<usize>>;
const M: usize = 1e9 as usize + 9;

fn main() {
    input_byline! {
        n: usize,
    }
 
    let mut v = vec![vec![]; n];
    for i in 0..n {
        input_byline! {
            a: usize,
        }
        for j in 0..a {
            input_byline! {
                x: usize1,
                y: usize,
            }
            v[i].push((x, y));
        }
    }
 
    let mut ans = 0;
    for i in 0..1 << n {
        let mut ok = true;
        for j in 0..n {
            if (i >> j) & 1 == 0 {
                continue;
            }
            for k in 0..v[j].len() {
                if (i >> v[j][k].0) & 1 != v[j][k].1 {
                    ok = false
                }
            }
        }
        if ok {
            ans = max(ans, (i as u32).count_ones());
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <iostream>
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>
#define int long long
using namespace std;
signed main(){
  int N;cin>>N;
  vector<int>A(100000);
  for(int X=0;X<N;X++){
    int S;cin>>S;
    if(S!=0){
      A[S-1]++;
    }
    if(S!=N-1){
      A[S+1]++;
    }
    A[S]++;
  }
  int U=-1;
  int I;
  for(int X=0;X<100000;X++){
    if(U<A[X]){
      U=A[X];
    }
  }
  cout<<U<<endl;
}

Measured memory_bytes: 3960
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef tree<int,null_type,less<int >,rb_tree_tag,tree_order_statistics_node_update>indexed_set;
template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p);
template <class T>
ostream &operator <<(ostream &os, vector<T>&v);
template <class T>
ostream &operator <<(ostream &os, set<T>&v);
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v);
#ifndef ONLINE_JUDGE
#define debug(a) cout<<#a<<" --> "<<(a)<<"\n";
#define debug2(a) cout<<#a<<" --> "<<(a)<<" ";
#define HERE cout<<"here - "<<__LINE__<<"\n";
#else
#define debug(a)
#define debug2(a)
#define HERE
#endif
const ll mod = 100000007;
const int N = 15;
typedef pair<int,int> pii;

void TEST_CASES(int cas)
{
    int n,k;
    cin>>n>>k;
    vector<int>a(n);
    for(int &i:a)
        cin>>i;
    sort(a.begin(),a.end());
    int sum =0;
    for(int i=0;i<k;i++)
    {
        sum+=a[i];
    }
    printf("%d\n",sum);
}


/*
*/

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1,cas=0;
    //scanf("%d",&t);
    while(t--)
    {
        TEST_CASES(++cas);
    }
    return 0;
}



//os.order_of_key(v): returns how many elements strictly less than v
//os.find_by_order()

template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p)
{
    os<<"{"<<p.first<<", "<<p.second<<"} ";
    return os;
}
template <class T>
ostream &operator <<(ostream &os, vector<T>&v)
{
    os<<"[ ";
    for(int i=0; i<v.size(); i++)
    {
        os<<v[i]<<" " ;
    }
    os<<" ]";
    return os;
}

template <class T>
ostream &operator <<(ostream &os, set<T>&v)
{
    os<<"[ ";
    for(T i:v)
    {
        os<<i<<" ";
    }
    os<<" ]";
    return os;
}
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v)
{
    for(auto i:v)
    {
        os<<"Key : "<<i.first<<" , Value : "<<i.second<<endl;
    }
    return os;
}


Measured memory_bytes: 3724
using System;
using System.Collections.Generic;
using System.Linq;

namespace b
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var p = Console.ReadLine().Split().Select(i => int.Parse(i)).ToList();

            var count = 0;
            for(var i = 1; i < n - 1; i++){
                var l = p.GetRange(i-1,3);
                var min = l.Min();
                var max = l.Max();

                if(p[i] != min && p[i] != max){
                    count++;
                }
            }

            Console.WriteLine(count);
        }
    }
}


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

int main(){ 
    int a,b;
    cin >> a >> b;
    if(a-b > 0) cout << a - b << endl;
    else cout << 0 << endl;
   
}   

Measured memory_bytes: 256
n = int(input())
a = list(map(int,input().split()))
count = 0
for i in range(n):
    minj = i
    for j in range(i,n):
        if a[j] < a[minj]:
            minj = j
    a[i],a[minj] = a[minj],a[i]
    if i != minj:
        count += 1

print(*a)
print(count)


Measured memory_bytes: 5612
import java.util.Scanner;



public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		double M = sc.nextInt();
		int[] A = new int[N];
		double sum = 0;
		for(int i=0; i<N; i++) {
			A[i] = sc.nextInt();
			sum += A[i];
		}
		sc.close();
		int temp;
		int n=A.length;
		for(int i=0; i<n-1; i++) { //降順に並び替え
			for(int j=i+1; j<n; j++) {
				if(A[i]<A[j]) {
					temp=A[i];
					A[i]=A[j];
					A[j]=temp;
				}
			}
		}

		double line = 1/(4*M);


		for(int i=0; i<M; i++) {
			if( A[i]/sum < line ) {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");



	}

}


Measured memory_bytes: 36128
#include<stdio.h>
int main()
    {int S,h,m,s;
    scanf("%d",&S);
    h=S/3600;
    m=S%3600/60;
    s=S-3600*h-m*60;





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






    return 0;

    }



Measured memory_bytes: 2044
n=int(input())
for i in range(n):
    
    x,y,z=map(int,input().split())
    a=x**2
    b=y**2
    c=z**2
    
    if c==(a+b):
        print('YES')
    elif b==(a+c):
        print('YES')
    elif a==(b+c):
        print('YES')
    else:
        print('NO')
    
    


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

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


  return 0;
}


Measured memory_bytes: 256
pub fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

pub fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

pub fn read_vec2<T: std::str::FromStr>(n: usize) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

pub fn read_col<T: std::str::FromStr>(n: usize) -> Vec<T> {
    (0..n).map(|_| read()).collect()
}

fn main() {
    let n: usize = read();
    println!("{}", (n + 1) / 2);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
#define FI(i,a,b) for(int i=(a);i<=(b);++i)
#define FD(i,b,a) for(int i=(b);i>=(a);--i)
#define DEBUG(x) cerr << #x << ": " << (x) << endl;
constexpr LL inv(LL x, LL m) { return x > m ? inv(x % m, m) : x > 1 ? inv(m % x, m) * (m - m / x) % m : x; }
constexpr LL mpow(LL a, LL k, LL m) { LL r(1); for (a %= m; k; k >>= 1, a = a * a % m) if (k & 1)r = r * a % m; return r; }

const int N = 1005, M = 1e9 + 7;
int n, m, A[N], B[N];

int main() {
    cin >> n >> m;
    FI(i, 1, n) scanf("%d", A + i);
    FI(i, 1, m) scanf("%d", B + i);
    sort(A + 1, A + 1 + n);
    sort(B + 1, B + 1 + m);
    FI(i, 1, n - 1) if (A[i] == A[i + 1]) return puts("0"), 0;
    FI(i, 1, m - 1) if (B[i] == B[i + 1]) return puts("0"), 0;
    LL ans = 1;
    int cnt = 0;
    FD(x, n * m, 1) {
        int r = n + 1 - (lower_bound(A + 1, A + 1 + n, x) - A);
        int c = m + 1 - (lower_bound(B + 1, B + 1 + m, x) - B);
        bool br = binary_search(A + 1, A + 1 + n, x);
        bool bc = binary_search(B + 1, B + 1 + m, x);
        if (br && bc) ans = ans;
        else if (br && !bc) ans = ans * c % M;
        else if (!br && bc) ans = ans * r % M;
        else {
            if (r * c < cnt) return puts("0"), 0;
            ans = ans * (r * c - cnt) % M;
        }
        cnt++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i;
    string s;
    cin>>n>>s;
    for(i=0;i<s.size();i++)
       {
        int x=int(s[i]);
    x=(x+n);
    if(x>=91)
    {

    x=(abs(x-91))%26;
    x=x+65;

    }

    s[i]=char(x);
      }
      cout<<s;
return 0;



}


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

using namespace std;

typedef long long lint;

lint a, b, n;

lint mx;

void verif(lint last)
{
    if(last >= 0 && last <= n)
    {
        lint x = floor(1.0D * a * last / b) - a * floor(1.0D * last / b);
        mx = max(mx, x);
    }
}

int main()
{
    cin >> a >> b >> n;
/*
    if(b == 1)
    {
        cout << "0\n";
        return 0;
    }*/

    mx = 0;
    if(n <= 100000000)
    {
        for(lint i = 1; i <= n; i ++)
        {
            lint x = floor(1.0D * a * i / b) - a * floor(1.0D * i / b);
/*
            if(x > mx)
            {
                cout << "MAX CLA " << i << " " << x << "\n";
            }*/

            mx = max(mx, x);
        }
    }

    if(b != 1)
    {
        lint last = n / (b - 1) * (b - 1);

        verif(last);
        verif(last - b);
        verif(b - 1);
        verif(b / 2);
        verif(b / 2 + 1);
        verif(b / 2 - 1);
        verif(b / 2 - 2);
        verif(b / 2 - 3);
        verif(b / 2 + 2);
        verif(b / 2 + 3);
        verif(n);
        verif(n - 1);

        for(lint i = last; i >= last - 10000000; i --)
            verif(i);

        for(int i = 0; i <= 100000000; i ++)
            verif(i);
    }

    cout << mx << "\n";

    return 0;
}


Measured memory_bytes: 3640
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();

		long i;
		long sum = 0;
		for(i = 1; i <= n;i ++) {
			if(!(i % 3 == 0 || i % 5 == 0)) {
				sum += i;
			}
		}

		System.out.println(sum);
	}
}


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

int main()
{
  ll n, m, ans;
  m = ans = 0;
  cin >> n;
  for (ll i = 0; i < n; i++)
  {
    ll buf;
    cin >> buf;
    if (m > buf)
    {
      ans += m - buf;
    }
    else
    {
      m = buf;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T>
using vec = std::vector<T>;

int main() {
    string S1,S2,S3;
    cin >> S1 >> S2 >> S3;
    string ans = "";
    cout << S1[0];
    cout << S2[1];
    cout << S3[2] << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int main()
{
    long long int n,a,b,sum,q,r;
    scanf("%lld%lld%lld",&n,&a,&b);
    sum=a+b;
    q=n/sum;
    r=n%sum;
    if(r<a){
        printf("%lld\n",(a*q)+r);
    }
    else if(r>=a)
        printf("%lld\n",(a*q)+a);
}


Measured memory_bytes: 128
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main(void) {
  int i, N, K, Q;
  int A[100001] = { 0 };
  int point[100001] = { 0 };
  scanf("%d", &N);
  scanf("%d", &K);
  scanf("%d", &Q);
  for (i = 0; i < Q; i++) {
    scanf("%d", A + i);
    point[A[i] - 1]++;
  }
  for (i = 0; i < N; i++) {
    if (point[i] > Q - K) {
      printf("Yes\n");
    }
    else {
      printf("No\n");
    }
  }


  return 0;
}

Measured memory_bytes: 1280
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>
#include <bitset>
#include <cstdint>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

int main() {
  i64 a[4];
  scanf("%1d%1d%1d%1d", &a[0], &a[1], &a[2], &a[3]);
  for (i64 i = 0; i < 8; ++i) {
    i64 y = a[0];
    for (i64 j = 0; j < 3; ++j) {
      if (i & (1 << j)) y += a[j + 1]; else y -= a[j + 1];
    }
    if (y == 7) {
      cout << a[0];
      for (i64 j = 0; j < 3; ++j) {
        if (i & (1 << j)) cout << '+'; else cout << '-';
        cout << a[j + 1];
      }
      cout << "=7\n";
      return 0;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define lli  long long int   //used int to avoid mle
#define ulli unsigned long long int 
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define loop(i,a,b) for(lli i=a;i<b;i++)
#define initialize(array,size,value) for(lli i=0;i<size;i++) array[i]=value
#define couta(array,size) for(lli i=0;i<size;i++) cout<<array[i]<<" "
#define vl vector<lli>
#define vp vector< pair <lli,lli> >
#define sl set<lli>
#define spl set<pll>
#define msl multiset <lli>
#define msp multiset <pll>
#define pll pair<lli, lli>
#define mll map<lli, lli>              //for( map<lli, lli>::iterator i=temp.begin();i!=temp.end();i++)cout<<i->fi<<" "<<i->se<<endl;
#define mvl map<lli, vl>
#define umll unordered_map<lli, lli>
#define vt vector<pair<lli, pll >  >
#define vf vector<pair<pll,pll > >
#define qu queue<lli>
#define pq priority_queue<lli>
#define dq deque <lli>
#define ptr vector<lli>::iterator
#define bs(array,x) binary_search(array.begin(),array.end(),x)
#define lb(array,x) lower_bound(array.begin(),array.end(),x)
#define ub(array,x) upper_bound(array.begin(),array.end(),x)
#define nobw(array,i,j) upper_bound(array.begin(), array.end(), j)-lower_bound(array.begin(), array.end(), i) //number of numbers between i & j
#define vc clear()
#define fbo find_by_order //returns iterator
#define fok order_of_key //return index
#define endl '\n'
#define sp system("pause");
#define INF 9223372036854775807
#define MINF -9223372036854775808
#define start_routine() int begtime = clock();
#define end_routine() int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0
lli mod=998244353;
lli inf=9223372036854775807;
//string s=bitset<32>(n).to_string();
typedef tree<lli,null_type,less<lli>,rb_tree_tag, // change both to lli if set is req insted of multiset
tree_order_statistics_node_update> indexed_set;
#define UNASSIGNED 0  
//&& + - ! ~ ++ - - () *
lli ani;
int main()
{
	lli n;
	cin>>n;
	lli p26[50];
	p26[0]=1;
	for(lli i=1;i<50;i++)p26[i]=p26[i-1]*26;
	lli psum[50];
	lli nc;
	for(lli i=1;i<50;i++){
		if(n>p26[i])n-=p26[i];
		else {nc=i;break;}
	}
	//cout<<nc<<" "<<n;n--;
	n--;
	while(nc--){
		cout<<char('a'+(n)/p26[nc]);
		n=n%p26[nc];
	}
	
	
	
	
 
    return 0;
}

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

const long  double pi = 3.141592653589793238;

int main()
{
	long  double  r ;
	cin>>r;
	long  double  a = ((long double)2.00000000000000000000*pi*r);
	cout<<fixed<<setprecision(20)<<a<<endl;
}

//6.28318530717958623200


Measured memory_bytes: 3780
import sys
s = raw_input().rstrip().split(" ")
arr = []
arr.append(int(s[0]))
arr.append(int(s[1]))
arr.append(int(s[2]))
maxnum = -sys.maxint
minnum = sys.maxint
maxi=0
mini=0
for i in xrange(3):
	if maxnum<arr[i]:
		maxnum=arr[i]
		maxi=i
	if minnum>arr[i]:
		minnum=arr[i]
		mini=i
print minnum,arr[3-maxi-mini],maxnum

Measured memory_bytes: 6284