akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#define ld			long double
#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define MOD         1000000007
#define sd(t) 		scanf("%d",&(t))
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define hii 		cout << "hii" << endl
#define okay 		cout << "okay" << endl
#define hey 		cout << "hey" << endl

template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.first << ' ' << v.second; return os; }
template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; } 
 
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <class Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; }
    template <class Arg1, class... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args) {
        const char* sep = strchr(names + 1, ',');
        cerr.write(names, sep - names) << " : " << arg1 << "  ";
        __f(sep + 1, args...);
    }
#else
#define trace(...) 
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#endif // ifndef ONLINE_JUDGE

void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

clock_t time_p=clock();
void starboy1299()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

const int N = 1e5+5;
int dp[105][N];
int arr[105];
int n, k;
int f(int idx, int k){
	if(k < 0) return 0;
	if(k==0) return 1;
	if(idx==n) return 1;

	if(dp[idx][k]!=-1) return dp[idx][k];

	int mini = min(k, arr[idx]);
	int ans = f(idx+1, k) - f(idx+1, k-mini-1) + MOD;

	ans %= MOD;
	ans += f(idx, k-1);
	ans %= MOD;

	return dp[idx][k] = ans;
}

void solve()
{
	cin >> n >> k;
	memset(dp, -1, sizeof(dp));

	rep(i, 0, n) cin >> arr[i];

	int ans = f(0, k) - f(0, k-1) + MOD;
	ans %= MOD;
	cout << ans << endl;
}			 	

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




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

using namespace std;

int main(){
    string S;
    cin >> S;
    int cnt=0,ans=0;
    for(int i=0;i<S.size();i++){
        if(S[i]=='A'||S[i]=='T'||S[i]=='G'||S[i]=='C'){
            cnt++;
        }else{
            ans = max(ans,cnt);
            cnt=0;
        }
    }
    cout << max(ans,cnt) << '\n';
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  string n;
  cin>>n;
  bool f=1;
  for(int i=0;i<n.size();i++)
    f=(n.at(i)!=n.at(n.size()-1-i)?0:f);
  cout<<(f?"Yes":"No")<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	unsigned long int a, b, c;
	int i;

	scanf("%ld", &a);

	for (i = 0; 3 > i; i++) {
		if (7 == a % 10) {
			printf("Yes");

			return 0;
		}

		a = a / 10;
	}

	printf("No");

	return 0;
}

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

int main(){
    int a,b,c,d,x,y;
    cin >> a >> b >> c >> d;
    x=c-a;
    y=d-b;
    cout << c-y << " " << d+x << " " << a-y << " " << b+x << endl;
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;

namespace ITP1_2_B
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            Console.WriteLine(n[0] < n[1] && n[1] < n[2] ? "Yes" : "No");
        }
    }
}

Measured memory_bytes: 9248
import java.util.Scanner;
public class Main {
	@SuppressWarnings("resource")
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		long K=sc.nextLong();
		int A[]=new int[N];
		for(int i=0;i<N;i++) {
			A[i]=sc.nextInt();
		}
		if(A[0]==1) {
			System.out.println(1);
			System.exit(0);
		}
		int B[]=new int[N];
		int next=0;
		long loop=0;
		for(int i=0;i<K;i++) {
			if(B[next]==0) {
			B[next]=i+1;
			next=A[next]-1;
			K--;
					}else {
						loop=i+1-B[next];
						K%=loop;
						break;
					}

		}
		for(int i=0;i<K;i++) {
			next=A[next]-1;
		}
		System.out.println(next+1);

}
}


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

int main(){
	string s;
	cin >> s;
	if(s == "Sunny") cout << "Cloudy" << endl;
	else if(s == "Cloudy") cout << "Rainy" << endl;
	else cout << "Sunny" << endl;
	return 0;
}

Measured memory_bytes: 256
X, K, D = map(int, input().split())
q, r = divmod(X, D)
if X < 0:
    q += 1
    q *= -1
    r -= D
if q >= K:
    if X >= 0:
        print(abs(X - K * D))
    else:
        print(abs(X + K * D))
else:
    if (K - q) % 2 == 0:
        print(abs(r))
    else:
        print(min(abs(r - D), abs(r + D)))


Measured memory_bytes: 9132
def numinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

def main():
    a = numinput()
    W = a[0]; H = a[1]; x = a[2]; y = a[3]; r = a[4]
    if x >= r and x + r <= W and y >= r and y + r <= H: print("Yes")
    else: print("No")

if __name__ == "__main__":
    main()



Measured memory_bytes: 5600
#include<iostream>
using namespace std;
int main(){
    int a,b,c,d,e,f,g,h,x=0,y=0;
    while(cin >> a >> b >> c >> d >> e >> f >> g >> h){
        x=0;
        y=0;
        if (a==e){x=x+1 ;e=e+10;} 
        if (b==f){x=x+1;f=f+10;} 
        if (c==g){x=x+1;g=g+10;}
        if (d==h){x=x+1;h=h+10;}
        if (e==a || e==b || e==c || e==d){y=y+1;}
        if (f==a || f==b || f==c || f==d){y=y+1;}
        if (g==a || g==b || g==c || g==d){y=y+1;}
        if (h==a || h==b || h==c || h==d){y=y+1;}
        cout << x << " " << y << endl;
    }  
return 0 ;
}


Measured memory_bytes: 3036
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
#define per(i,n) for(int i = n-1; i >= 0; i--)
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<ll> vll;
const long long mod = 1000000007LL;

int main() {
  ll n, m;
  cin >> n >> m;
  vll x(n), y(n), z(n);
  rep(i,n) cin >> x[i] >> y[i] >> z[i];
  ll ans = 0LL;
  rep(i,(1<<3)) {
    vll v;
    rep(j,n) {
      ll tmp = 0LL;
      if(i & 1) tmp += x[j];
      else tmp -= x[j];
      if(i>>1 & 1) tmp += y[j];
      else tmp -= y[j];
      if(i>>2 & 1) tmp += z[j];
      else tmp -= z[j];
      v.push_back(tmp);
    }
    sort(v.begin(),v.end());
    reverse(v.begin(),v.end());
    ll sum = 0LL;
    rep(j,m) sum += v[j];
    ans = max(ans,sum); 
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
 
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define ll long long
#define forn(i, a, b) for(int i = (a); i <= (b); ++i)
#define forev(i, b, a) for(int i = (b); i >= (a); --i)
#define VAR(v, i) __typeof( i) v=(i)
#define forit(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define file(s) freopen(s".in","r",stdin); freopen(s".out","w",stdout);
 
using namespace std;
 
const int maxn = (int)2e5 + 10;
const int maxM = (int)1.5e7 + 100;
const int mod = (int)1e9 + 7;
const int P = (int) 1e6 + 7; 
const double pi = acos(-1.0);
 
#define inf mod
 	
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;   
typedef vector<ll> Vll;               
typedef vector<pair<int, int> > vpii;
typedef vector<pair<ll, ll> > vpll;                        
typedef array<int, 3> triple;

int n, k, a[maxn];
void solve(){
	cin >> n >> k;
	forn(i, 1, n) cin >> a[i];
	forn(i, k + 1, n){
		if(a[i - k] < a[i]) puts("Yes");
		else puts("No");
	}
}

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

Measured memory_bytes: 4408
#include <bits/stdc++.h>
using namespace std;
int H1, H2, M1, M2, K;

int main()
{
  cin >> H1 >> M1 >> H2 >> M2 >> K;
  M1 += H1 * 60;
  M2 += H2 * 60;
  /*  if(M1 > M2){
    M2 +=1440;
  } */

  int ans = M2 - M1 - K;
  if (ans <= 0)
  {
    ans = 0;
  }

  cout << ans << endl;
}

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

using namespace std;
typedef long long ll;

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define REPR(i, n) for (ll i = (n); i >= 0; i--)
#define FOR(i, m, n) for (ll i = (m); i < (n); i++)
#define FORR(i, m, n) for (ll i = (m); i >= (n); i--)
#define INF 1e9
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((ll)(x).size())
#define SORT(x) sort((x).begin(), (x).end())
#define dump(x) cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl

int main(int argc, char const *argv[])
{
    ll n;
    string s;
    cin >> n;
    cin >> s;
    ll r = 0, b = 0;
    REP(i, n)
    {
        if (s[i] == 'R')
            r++;
        else
            b++;
    }
    if (r > b)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


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

const int mod = 1e9 + 7;

int main() {

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

    vector <vector <char> > grid(h, vector <char>(w));
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            cin >> grid[i][j];
        }
    }

    vector <vector <int> > dp(h, vector <int> (w, 0));
    dp[0][0] = 1;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (grid[i][j] == '#') continue;

            if (i) dp[i][j] = (dp[i][j] + dp[i - 1][j]) % mod;
            if (j) dp[i][j] = (dp[i][j] + dp[i][j - 1]) % mod;
        }
    }

    cout << dp[h - 1][w - 1];

    return 0;
}

Measured memory_bytes: 5248
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <chrono>
#include <numeric>

using namespace std;

int main(){
  int a, b, c;
  cin >> a >> b >> c;
  if (a == b) {
    cout << c << endl;
  }
  if (a == c) {
    cout << b << endl;
  }
  if (c == b) {
    cout << a << endl;
  }
  
}


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

using namespace std;

#define INF 1001001001  //int32_t
#define MOD 1000000007
#define MOD2 

#define all(a)  (a).begin(),(a).end()

#define mkp make_pair
#define pb push_back

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

int main(){

    bool flag=false;
    ll ans=0,sum=0;

    int n,m;
    cin >>n;

    //cout <<fixed<<setprecision(16)<< << endl;
    cout << n*n << endl;

    //if(flag)cout << "Yes" <<endl;
    //else cout << "No" <<endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <queue>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <complex>

int main(){
  
  long long int N, tmp;
  std::vector<long long int> A;

  scanf("%lld", &N);
  for(long long int i = 0; i < N; i++){
    scanf("%lld", &tmp);
    A.push_back(tmp);
  }

  std::sort(A.begin(), A.end());

  long long int yes = 1;
  for(long long int i = 0; i < N-1; i++){
    if(A[i] == A[i+1]){
      yes = 0;
      break;
    }
  }

  std::cerr << "Answer: " << std::endl;
  if(yes){
    std::cout << "YES" << std::endl;
  }
  else{
    std::cout << "NO" << std::endl;
  }

  return 0;
}


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

int main(){
  string s;
  // 初期化忘れないように
  int alpha[26] = {0};
  // for (int i = 0; i < 26; i++){
  //   cout <<  alpha[i] << endl;
  // }
  while(getline(cin, s)){
    for (int i = 0; i < s.length(); i++){
      if (s[i] >= 65 && s[i] <= 90){
        int index;
        index = s[i] - 65;
        alpha[index] = alpha[index] + 1;
      }else if(s[i] >= 97 && s[i] <= 122){
        int index;
        index = s[i] - 97;
        alpha[index] = alpha[index] + 1;
      }
    }
  }

  for (int i = 0; i < 26; i++){
    char a;
    a = i + 97;
    cout << a << " : " << alpha[i] << endl;
  }
}


Measured memory_bytes: 3176
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));

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

	ll X,Y;
	cin>>X>>Y;
	if(abs(X-Y)<=1)cout<<"Brown"<<endl;
	else cout<<"Alice"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

int main(void){
  SPEEDUP
  cout << setprecision(15);
  string s;cin >> s;
  int N=s.length();
  int k = 1;
  string pre = s.substr(0,1);
  int index = 1;
  int presize = 1;
  while(index+presize-1 < N){
    if(presize==1){
      if(pre != s.substr(index,1)){
        presize = 1;
        pre = s.substr(index,1);
        ++index;
        ++k;
      }else{
        if(index+2<=N){
          ++k;
          presize == 2;
          pre = s.substr(index,2);
          index+=2;
        }else index++;
      }
    }else{
      ++k;
      presize = 1;
      pre = s.substr(index,1);
      ++index;
    }
  }
  cout << k << endl;
  return 0;
}


Measured memory_bytes: 720
#include <stdio.h>
#include <string.h>
#include <ctype.h>

#define MESSAGE_MAX_LENGTH 30
#define MESSANGER_MAX 10

void decode(char [], char []);
void decode_j(char []);
void decode_c(char []);
void decode_e(char []);
void decode_a(char []);
void decode_p(char []);
void decode_m(char []);

int main(void) 
{
	int n;
	char message[MESSAGE_MAX_LENGTH], order[MESSANGER_MAX];
	int i;

	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		scanf("%s", order);
		scanf("%s", message);

		decode(message, order);

		printf("%s\n", message);
	}

	return 0;
}

void decode(char message[], char order[]) 
{
	int i;

	for (i = strlen(order) - 1; i >= 0; i--) {
		switch (order[i]) {
		case 'J':
			decode_j(message);
			break;
		case 'C':
			decode_c(message);
			break;
		case 'E':
			decode_e(message);
			break;
		case 'A':
			decode_a(message);
			break;
		case 'P':
			decode_p(message);
			break;
		case 'M':
			decode_m(message);
			break;
		}
	}
}

void decode_j(char message[]) 
{
	char tmp = message[strlen(message) - 1];
	int i;

	for (i = strlen(message) - 1; i >= 0; i--) 
		message[i] = message[i - 1];

	message[0] = tmp;
}

void decode_c(char message[]) 
{
	char tmp = message[0];
	int i;

	for (i = 0; i < strlen(message) - 1; i++) 
		message[i] = message[i + 1];

	message[strlen(message) - 1] = tmp;
}

void decode_e(char message[]) 
{
	char tmp;
	int i, j;

	for (i = 0, j = (strlen(message) % 2 == 0) ? (strlen(message) / 2) : (strlen(message) / 2 + 1); j < strlen(message); i++, j++) {
		tmp		   = message[i];
		message[i] = message[j];
		message[j] = tmp;
	}
}

void decode_a(char message[]) 
{
	char tmp;
	int i, j;

	for (i = 0, j = strlen(message) - 1; i < j; i++, j--) {
		tmp		   = message[i];
		message[i] = message[j];
		message[j] = tmp;
	}
}	

void decode_p(char message[]) 
{
	int i;

	for (i = 0; i < strlen(message); i++) {
		if (isdigit(message[i])) {
			if (message[i] == '0') {
				message[i] = '9';
			} else {
				message[i]--;
			}
		}
	}
}

void decode_m(char message[])
{
	int i;

	for (i = 0; i < strlen(message); i++) {
		if (isdigit(message[i])) {
			if (message[i] == '9') { 
				message[i] = '0';
			} else {
				message[i]++;
			}
		}
	}
}

Measured memory_bytes: 588
#include "bits/stdc++.h"
using namespace std;
int a[100000], dp[100002];
int main()
{
	int n;
	scanf("%d", &n);
	dp[0] = 0;
	for(int i = 1; i < n + 2; dp[i++] = 1 << 30){}
	for(int i = 0; i < n; scanf("%d", &a[i++])){}
	for(int i = 0; i < n - 1; ++i)
	{
		dp[i + 1] = min(dp[i + 1], dp[i] + abs(a[i + 1] - a[i]));
		dp[i + 2] = min(dp[i + 2], dp[i] + abs(a[i + 2] - a[i]));
	}
	printf("%d\n", dp[n - 1]);
}

Measured memory_bytes: 1152
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <unordered_map>
using namespace std;

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

const int maxn = 1e5 + 10;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;

#define dbg(x1) cout<<#x1<<" = "<<(x1)<<endl
#define dbg2(x1,x2) cout<<#x1<<" = "<<(x1)<<" "<<#x2<<" = "<<(x2)<<endl
#define dbg3(x1,x2,x3) cout<<#x1<<" = "<<(x1)<<" "<<#x2<<" = "<<(x2)<<" "<<#x3<<" = "<<(x3)<<endl
int dp[200][20000];
int a[maxn];
int main() {
    //freopen(".in", "r", stdin);
    int n;scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    dp[0][0]=1;
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<=10000;j++) dp[i][j]=dp[i-1][j];
        for(int j=a[i];j<=10000;j++)
        {
            dp[i][j]=(dp[i][j]|dp[i-1][j-a[i]]);
        }
    }
    int ans=0;
    for(int i=1;i<=10000;i++)
    {
        if(dp[n][i]&&(i%10!=0)) ans=i;
    }
    printf("%d\n",ans);
    return 0;
}



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

int main(){
	int x,y,t;
	while(1){
		cin>>x>>y;
		if(x==0&&y==0)break;
		if(x>y){
			t=y;
			y=x;
			x=t;
		}
			cout<<x<<' '<<y<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let a: usize = iterator.next().unwrap().parse().unwrap();
    let b: usize = iterator.next().unwrap().parse().unwrap();
    let t: usize = iterator.next().unwrap().parse().unwrap();

    let mut current = a;
    let mut ans = 0;
    while current <= t {
        ans += b;
        current += a;
    }
    return ans.to_string();
}


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

#define         ll      long long int

int main( )
{
    ll n, i, a, two = 0, d;

    cin >> n;
    for (i = 0; i < n; i++)
    {
        cin >> d;
        while (d % 2 == 0)
        {
            d /= 2;
            two++;
        }
    }
    cout << two << "\n";
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int K;
  cin>>K;
  int d=K%10;
  int c=(K%100-d)/10;
  int b=(K%1000-10*c-d)/100;
  int a=K/1000;
  

  if (a+b+c+d==7){
    cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"=7"<<endl;
  }
  else if (a+b+c-d==7){
    cout<<a<<"+"<<b<<"+"<<c<<"-"<<d<<"=7"<<endl;
  }
  else if (a+b-c-d==7){
    cout<<a<<"+"<<b<<"-"<<c<<"-"<<d<<"=7"<<endl;
  }
  else if (a+b-c+d==7){
    cout<<a<<"+"<<b<<"-"<<c<<"+"<<d<<"=7"<<endl;
  }
  else if (a-b+c+d==7){
    cout<<a<<"-"<<b<<"+"<<c<<"+"<<d<<"=7"<<endl;
  }
  else if (a-b+c-d==7){
    cout<<a<<"-"<<b<<"+"<<c<<"-"<<d<<"=7"<<endl;
  }
  else if (a-b-c-d==7){
    cout<<a<<"-"<<b<<"-"<<c<<"-"<<d<<"=7"<<endl;
  }
  else if (a-b-c+d==7){
    cout<<a<<"-"<<b<<"-"<<c<<"+"<<d<<"=7"<<endl;
  }
  
}



Measured memory_bytes: 256
#include <stdio.h>
#define min(a, b) ((a<=b)?a:b)
#define max(a, b) ((a>=b)?a:b)

int main() {
  int n, i, tmp, mi=1e9, mx=0;
  scanf("%d", &n);
  for (i=0; i < n; ++i) {
   scanf("%d", &tmp);
    mi=min(mi, tmp);
    mx=max(mx, tmp);
  }
  printf("%d\n", mx-mi);
}

Measured memory_bytes: 2092
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
int aa[100005];
int ab[100005];
int ac[100005];

void solve(){
    int x,y,a,b,c;
    cin>>x>>y>>a>>b>>c;
    priority_queue<int>pq;
    for(int i=0;i<a;i++)cin>>aa[i];
    for(int i=0;i<b;i++)cin>>ab[i];
    for(int i=0;i<c;i++)cin>>ac[i];
    sort(aa,aa+a);
    sort(ab,ab+b);
    sort(ac,ac+c);
    reverse(aa,aa+a);
    reverse(ab,ab+b);
    reverse(ac,ac+c);
    ll ans = 0;
    for(int i=0;i<x;i++){
        pq.push(-aa[i]);
        ans+=aa[i];
    }
    for(int i=0;i<y;i++){
        pq.push(-ab[i]);
        ans+=ab[i];
    }
    for(int i=0;i<c;i++){
        int xx = -pq.top();
        pq.pop();
        if(ac[i]>xx){
            ans-=xx;
            ans+=ac[i];
        }
    }
    cout<<ans<<endl;
}
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t=1;
//	cin>> t;
	while(t--)solve();
	return 0;
}


Measured memory_bytes: 2552
n = gets.to_i
num_list = [1]
i = 1
while true
  if 6**i <= n
    num_list << 6**i
  else
    break
  end
  i += 1
end
j = 1
while true
  if 9**j <= n
    num_list << 9**j
  else
    break
  end
  j += 1
end
num_list.sort!
dp = Array.new(n,nil)
dp[0] = 0
k = 0
while k <= n
  if dp[k]
    num_list.each do |num|
      if !dp[k+num]
        dp[k+num] = dp[k] + 1
      else
        dp[k+num] = [dp[k+num],dp[k]+1].min
      end
    end
  end
  k += 1
end
puts dp[n]

Measured memory_bytes: 15608
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define ms(a,b) memset(a,b,sizeof(a))
#define msn(a,n,b) for(int i=0;i<=n;i++)a[i]=b
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define fi first
#define se second
using namespace std;
mt19937 rng_32(chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
const int mod=1e9+7;
const int seed=233;
const double PI=acos(-1.0);
const double eps=1e-7;
const int inf=0x3f3f3f3f;
const int max_n=100005;
namespace {
    inline int Add(int x,int y){return (x+=y)>=mod?x-mod:x;}
    inline int Sub(int x,int y){return (x-=y)<0?x+mod:x;}
    inline int Mul(int x,int y) {return 1ll*x*y%mod;}
    inline int Pow(int x,int y=mod-2){if(y==0)return 1;int res=1;while(y){if(y&1)res=1ll*res*x%mod;x=1ll*x*x%mod;y>>=1;}return res;}
}
/**********************head************************/
int n;
int p[max_n];
int a[max_n],b[max_n];
int f[max_n];
int solve(int *a){
    for(int i=1;i<=n;i++)p[i]=i;
    int res=1;
    do{
        bool f=true;
        for(int i=1;i<=n;i++)if(p[i]!=a[i])f=false;
        if(f==true)return res;
        res++;
    }while(next_permutation(p+1,p+n+1));
}
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",a+i);
    for(int i=1;i<=n;i++)scanf("%d",b+i);
    f[0]=1;
    for(int i=1;i<=n;i++)f[i]=f[i-1]*i;
    printf("%d\n",abs(solve(a)-solve(b)));
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<functional>
#include<math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pf(n) printf("%d\n",n)
#define pff(a,b) printf("%d  %d\n",a,b);
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1001001001;
const double PI = acos(-1);

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

	int cnt = 0;
	if (s[0] == 'R' or s[2] == 'R') {
		cnt = 1;
		if (s[1] == 'R') cnt = 2;
	}
	else if (s[1] == 'R') {
		cnt = 1;
	}
	if (s[0] == 'R' and s[1] == 'R' and s[2] == 'R') cnt = 3;

	pf(cnt);

	return 0;
}

Measured memory_bytes: 3692
#include<iostream>

using namespace std;

//累乗
/*
int pow(int a,int b)
{
  int i,ans;
  ans=1;
  for(i=0;i<b;i++)
  {
    ans=ans*a;
  }
  return ans;
}*/
  

int main() 
{
  int i,N,P,energy,sum,ans;
  cin>>N;
  int X[N];
  ans=800000;//あり得ないでかい数字
  
  for(i<0;i<N;i++)
  {
    cin>>X[i];
  }
     
  //座標を指定
  for(P=0;P<101;P++)
  {
    sum=0;
    for(i=0;i<N;i++)
    {
      energy=(P-X[i])*(P-X[i]);
      sum+=energy;
    }
    if(sum<ans)
      ans=sum; 
  }
  cout<<ans;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std; 
#define ll long long int
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define INF LLONG_MAX
#define PI acos(-1)
const ll MOD = 1e9 + 7;
#define fir first
#define sec second
#define all(x) x.begin(),x.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define rep(c,a,b) for(ll c=a;c<b;c++)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define min_heap priority_queue<pll,vector<pll>,greater<pll> >
ll dx4[]={-1,1,0,0};
ll dy4[]={0,0,-1,1};
ll dx8[]={-1,-1,-1,0,1,1,1,0};
ll dy8[]={-1,0,1,1,1,0,-1,-1};
bool isvalid(ll x,ll y,ll n,ll m)
{
    return (x>=0 and y>=0 and x<n and y<m);
}
ll isprime[1000];
vector<ll> prime;
void sievetoprime(ll n)
{
    mem(isprime,true);
    for(ll p=2;p*p<=n;p++)
    {
        if(isprime[p]==true)
        {
            for(ll i=p*p;i<=n;i+=p)
                isprime[i]=false;
        }
    }
}
ll lcm(ll a,ll b)
{
    return (a/__gcd(a,b))*b;
}
vector<ll> fact;
void find_fact_with_modulus(ll n,ll mod)
{
    fact.resize(n+2,0);
    fact[0]=fact[1]=1;
    for(ll i=2;i<=n;i++)
    {
        fact[i]=fact[i-1]*i%mod;
    }
}
ll pow_mod(ll x, ll n, ll mod) 
{
    if (n == 0) 
    	return 1;
    ll r = pow_mod(x,n/2,mod);
    r=r*r;
    r %= mod; 
    if (n % 2 == 1) 
    	r *= x;
    return r % mod;
}
// Returns n^(-1) % mod 
ll modInverse(ll n,ll mod) 
{ 
    return pow_mod(n, mod-2, mod); 
} 

ll ncrmod(ll n,ll r,ll mod)
{
	ll x=1;
	ll y=1;
	for(ll i=0;i<r;i++)
	{
		y=y*(i+1)%mod;
		x=x*(n-r+1+i)%mod;
	}
	// nCr % mod = (x * (y)^-1 )%mod;
	return (x*modInverse(y,mod))%mod;
}
void solve()
{
    ll n,a,b;
    cin>>n>>a>>b;
    ll x=pow_mod(2,n,MOD)-1;
    x-=ncrmod(n,a,MOD);
    x=(x+MOD)%MOD;
    x-=ncrmod(n,b,MOD);
    x=(x+MOD)%MOD;
    cout<<x;
}
int main()
{
    ll inpoup = 0;
    if(inpoup==1)
    {
        #ifndef ONLINE_JUDGE
            freopen("input.txt","r",stdin);
            freopen("output.txt","w",stdout);
        #endif
    }
    IOS
    ll t;
    t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
}

Measured memory_bytes: 256
#include<iostream> 
 
using namespace std; 
int main()
{
	int A; 
	int B; 
	cin >> A; 
	cin >> B; 
	int C = A * B; 
	int D = 1 * A; 
	int E = 1 * B - 1; 
	cout << C - (D + E) << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const int mod = 1e5;
const int MAX = 1e7;

int main() {
    vint a(3);
    rep(i,3) cin >> a[i];
    int ans = inf;
    vint p = {0,1,2};
    do {
        int sum = 0;
        rep(i,2) sum += abs(a[p[i]]-a[p[i+1]]);
        chmin(ans,sum);
    } while (next_permutation(p.begin(),p.end()));
    cout << ans << endl;
}

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

int main(){
    int a,b;
    cin >> a >> b;
    if(a*b%2==1) cout << "Yes" << endl;
    else cout << "No" <<endl;
    return 0;
}


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

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i > (b); i--)
#define ALL(a) (a).begin(), (a).end()

int main() {
    ll N, M, K, A[200001], B[200001];
    cin >> N >> M >> K;
    REP(i, N) cin >> A[i + 1];
    REP(i, N) A[i + 1] += A[i];
    REP(i, M) cin >> B[i + 1];
    REP(i, M) B[i + 1] += B[i];

    ll ans = 0;
    REP(i, N + 1) {
        if (A[i] > K) break;
        auto lb = lower_bound(B, B + M, K - A[i]);
        ll count = lb - B;
        if (*lb > K - A[i]) count--;
        count = max(0LL, count);
        ans = max(ans, count + i);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 6752
#include<stdio.h>
int main()
{
    long long int n,a[100006],i,cnt=0,max=0;
    scanf("%lld",&n);
    for(i=1; i<=n; i++)
    {
        scanf("%lld",&a[i]);

    }
    for(i=1; i<n; i++)
    {

        if(a[i]==a[i+1]||a[i]>a[i+1])
        {
            cnt++;

        }
        else
            cnt=0;
        if(max<cnt)
        {
            max=cnt;
        }
    }
    printf("%lld\n",max);
    return 0;
}


Measured memory_bytes: 896
#include <iostream>
#define REP(i, a, n) for(int i = a; i < n; i++)
using namespace std;


int tbl[10][10];
int cd[10][10][10][10];

int same(int a1, int b1, int c1, int d1, int e1, int a2, int b2, int c2, int d2, int e2) {
  return a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2 && e1 == e2;
}

int check(int a, int b, int c, int d, int e) {
  return !tbl[cd[a][b][c][d]][e];
}

int main(void) {
  REP(i, 0, 10) REP(j, 0, 10) cin >> tbl[i][j];

  REP(a, 0, 10) REP(b, 0, 10) REP(c, 0, 10) REP(d, 0, 10) {
    cd[a][b][c][d] = tbl[tbl[tbl[tbl[0][a]][b]][c]][d];
  }

  int cnt = 0, e;
  REP(a, 0, 10) REP(b, 0, 10) REP(c, 0, 10) REP(d, 0, 10) {
    e = cd[a][b][c][d];
    if(!same(a, b, c, d, e, b, a, c, d, e) && check(b, a, c, d, e)) { cnt++; continue; }
    if(!same(a, b, c, d, e, a, c, b, d, e) && check(a, c, b, d, e)) { cnt++; continue; }
    if(!same(a, b, c, d, e, a, b, d, c, e) && check(a, b, d, c, e)) { cnt++; continue; }
    if(!same(a, b, c, d, e, a, b, c, e, d) && check(a, b, c, e, d)) { cnt++; continue; }

    REP(i, 0, 10) if(!same(a, b, c, d, e, i, b, c, d, e) && check(i, b, c, d, e)) { cnt++; goto CONT; }
    REP(i, 0, 10) if(!same(a, b, c, d, e, a, i, c, d, e) && check(a, i, c, d, e)) { cnt++; goto CONT; }
    REP(i, 0, 10) if(!same(a, b, c, d, e, a, b, i, d, e) && check(a, b, i, d, e)) { cnt++; goto CONT; }
    REP(i, 0, 10) if(!same(a, b, c, d, e, a, b, c, i, e) && check(a, b, c, i, e)) { cnt++; goto CONT; }
    REP(i, 0, 10) if(!same(a, b, c, d, e, a, b, c, d, i) && check(a, b, c, d, i)) { cnt++; goto CONT; }

CONT: continue;
  }

  cout << cnt << endl;

  return 0;
}

Measured memory_bytes: 3132
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <functional>
#include <map>
#include <set>
#define Rep(i, n) for(int i=0;i<n;++i)
#define rep(i, n) for(int i=1;i<=n;++i)
#define ll long long int
#define INF 100000000
#define INFLL 100000000000
#define MOD 1000000007
#define PI 3.14159265359
#define All(a) (a).begin(), (a).end()

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

struct Edge {
  int to;     
  ll weight; 
  Edge(int t, ll w) : to(t), weight(w) { }
};

template<class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

template<class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}


int N, M, S, T;
using Graph = vector<vector<int>>;

int main () {
  cin >> N >> M;

  Graph G(N+1);

  Rep(i, M) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
  }

  cin >> S >> T;

  set<int> st;
  vector<bool> visited(N+1, false);
  st.insert(S);
  visited[S] = true;

  Rep(i, 4*N) {
    set<int> next_st;

    for (auto itr = st.begin(); itr != st.end(); ++itr) {
      int v = *itr;

      //cout << v << "\n";
      if ((i % 3) == 0) {
        visited[v] = true;
      }

      if ((i % 3 == 0) && (v == T)) {
        cout << i / 3 << "\n";
        return 0;
      }

      for (auto next_v: G[v]) {
        if (((i % 3) != 2) || !visited[next_v]) {
          next_st.insert(next_v);
        }
      }
    }

    //cout << "\n";

    st = next_st;
  }

  cout << -1 << "\n";
}

Measured memory_bytes: 7804
#include<bits/stdc++.h>
using namespace std;
bool check(string s){
	if(s[0]!='A')return false;
	int C=0;
	for(int i=2;i<s.length()-1;i++){
		if(s[i]=='C'){
			C++;
		}
	}
	if(C!=1)return false;
	int upper=0;
	for(int i=0;i<s.length();i++){
		if(s[i]>='A'&&s[i]<='Z'){
			upper++;
		}
	}
	if(upper!=2)return false;
	return true;
}
int main(){
	string s;cin>>s;
	cout<<(check(s)?"AC":"WA")<<endl;
}

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

#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define rep(i,n) for(int i=0;i<(n);++i)
#define repA(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)

using namespace std;
using ll = long long;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    int a[n][3];
    for(int i=0;i<n;i++)
    {
      for(int j=0;j<3;j++)
        cin>>a[i][j];
    }
    int dp[n][3];
    for(int i=0;i<3;i++)
      dp[0][i]=a[0][i];
    for(int i=1;i<n;i++)
    {
      dp[i][0]=a[i][0]+max(dp[i-1][1],dp[i-1][2]);
      dp[i][1]=a[i][1]+max(dp[i-1][0],dp[i-1][2]);
      dp[i][2]=a[i][2]+max(dp[i-1][0],dp[i-1][1]);
    }
      cout<<max(max(dp[n-1][1],dp[n-1][2]),dp[n-1][0])<<endl;
    return 0;
}

Measured memory_bytes: 2560
#include <iostream>
using namespace std;
int main(){
  int h, m = -1, c = 0, n;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> h;
	if(m <= h){
		c++;m=h;
    }
  }
  cout << c;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    int N = S.size();
    int count = 0;
    for (int i = 0; i < N; ++i){
        if (S[i] == '1' and (i % 2)) ++count;
        if (S[i] == '0' and (i % 2) == 0) ++count;
    }
    cout << min(count, N - count) << endl;
    return 0;
}

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

using ll = long long;

void read();
template<typename First, typename... Rest> void read(First& first, Rest&... rest);
void write();
template<typename First, typename... Rest> void write(First first, Rest... rest);
template<typename T> void write_vec(vector<T>& v, char divider);

int main(){
    ll A, B;
    read(A, B);
    write(A * B / __gcd(A, B));
    return 0;
}

//配列以外の入力を受け取る
void read(){

}
template<typename First, typename... Rest>
void read(First& first, Rest&... rest){
    cin >> first;
    read(rest...);
}
//
//配列以外を出力する
void write(){

}
template<typename First, typename... Rest>
void write(First first, Rest... rest){
    cout << first << " ";
    write(rest...);
}
//
//配列を区切って出力する
template<typename T>
void write_vec(vector<T>& v, char divider){
    for(size_t i = 0; i < v.size(); i++){
        cout << v[i] << divider;
    }
}
//

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define uu unsigned
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MOD 1000000007
#define pi pair<int,int>
#define pl pair<ll,ll>
#define mkp make_pair
#define ss second
#define ff first
#define all(x) x.begin(),x.end()
#define vi vector<int>
#define vl vector<ll>
#define vb vector<bool>
#define pb push_back
#define pf push_front
#define printcas cout<<"Case "<<cas<<": "
#define _ continue;
#define endl '\n'
#define __ cout<<endl;continue;
#define vc4d(nam,type,a,b,c,d,fix) vector<vector<vector<vector<type>>>> nam(a,vector<vector<vector<type>>>(b,vector<vector<type>>(c,vector<type>(d,fix))))
const ll oo=(1ll<<60);

int main()
{
     io;
    int T=1;
    //cin>>T;
    //for(int cas=1;cas<=T;cas++)
    while(T--)
    {
       ll x,k,d;
       cin>>x>>k>>d;
       ll ax=abs(x);
       if(ax/d>=k)
       {
           cout<<ax-(k*d);
           _
       }
       ll a=ax/d,b=a+1;
       if((k-a)&1)
       {
           cout<<abs(ax-(b*d));
           _
       }
       cout<<abs(ax-(a*d));
    }
    return 0;
}


Measured memory_bytes: 3584
#include <iostream>

using namespace std;

int main() {
	long long n; cin >> n;
	long long ans = 0;
	for (long long i = 1; i * i <= n; ++i) {
		if (n % i == 0) {
			long long m = n / i - 1;
          	if (m == 0) continue;
			if (n / m == n % m) ans += m;
		}
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



int main(){

	int N;
	scanf("%d",&N);

	printf("ABC%d\n",N);

	return 0;
}


Measured memory_bytes: 3844
import java.util.Scanner;

public class Main {

	/**
	 * Digit Number
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		while (scanner.hasNext()) {
			int a = scanner.nextInt();
			int b = scanner.nextInt();

			System.out.println(calcNumberDigit(a, b));
		}
	}

	private static int calcNumberDigit(int a, int b) {
		int target = a + b;
		int result = 1;
		int divide = 10;

		while (true) {
			if (target / divide < 1) {
				return result;
			}
			result++;
			divide *= 10;
		}
	}
}

Measured memory_bytes: 20436
#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
typedef pair<ll,P> T;
#define M 1000000007
#define all(a) (a).begin(),(a).end()
#define rep(i,n) reps(i,0,n)
#define reps(i,m,n) for(int i=(m);i<(n);i++)
int main(){
  ll n,k,c=0LL;cin>>n>>k;
  vector<ll> a(n),b(n);
  rep(i,n){cin>>a[i];c+=a[i];}
  if(c<=k){cout<<0;return 0;}
  rep(i,n)cin>>b[i];
  sort(all(a));sort(all(b),greater<ll>());
  vector<T> p(n);
  rep(i,n)p[i]=T(a[i]*b[i],P(a[i],b[i]));
  sort(all(p),greater<T>());
  ll ma=1e18,mi=0LL,md;
  while(ma-mi>1LL){
    ll t=k;
    md=(ma+mi)/2;
    rep(i,n){
      if(md<p[i].first){
        ll m=md/p[i].second.second;
        t-=(p[i].second.first-m);
      }else break;
    }
    if(t>=0)ma=md;
    else mi=md;
  }
  cout<<ma;
}

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

int main() {
  int n,m;
  cin>>n>>m;
  int ans[n]={0},a,b;
  for(int i=0;i<m;i++){
    cin>>a>>b;
    ans[a-1]++;
    ans[b-1]++;
  }
  for(int i=0;i<n;i++){
    cout<<ans[i]<<endl;
  }
  return 0;
}

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

vote = sum(a)
pop_n = 0
for i in range(n):
    if a[i] >= vote / (4*m):
        pop_n = pop_n + 1

if pop_n >= m:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3060
n = int(input())
w = []
for _ in range(n):
    w.append(input())

if len(w)>len(set(w)):
    print('No')
else:
    for i in range(n-1):
        if w[i][-1]!=w[i+1][0]:
            print('No')
            break
    else:
        print('Yes')

Measured memory_bytes: 3060
package main

import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
)

func main()  {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)

	scanner.Scan()
	N, err := strconv.Atoi(scanner.Text())
	if err != nil {
		log.Fatal(err)
	}

	scanner.Scan()
	A, err := strconv.Atoi(scanner.Text())
	if err != nil {
		log.Fatal(err)
	}

	scanner.Scan()
	B, err := strconv.Atoi(scanner.Text())
	if err != nil {
		log.Fatal(err)
	}

	repeat := N / (A + B)
	remain := N % (A + B)

	if remain > A {
		remain = A
	}

	fmt.Println(repeat * A + remain)
}

Measured memory_bytes: 1832
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define pcnt __builtin_popcount
#define show(x) cout<<#x<<" = "<<x<<endl;
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define fi first
#define se second
#define rng(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define sz(x) (int)(x).size()
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> si;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
typedef set<ll> sl;
typedef __int128_t lll;
typedef pair<lll,lll> plll;
typedef vector<lll> vlll;
template<typename T>string join(vector<T>&v)
{stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename A, size_t N, typename T>void Fill(A (&array)[N], const T&v)
{fill((T*)array,(T*)(array+N),v);}
template<typename T> T gcd(T a,T b){if(a>b)swap(a,b);for(;a>0;b%=a,swap(a,b));return b;}
ll modpow(lll a,lll n,ll m){if(a==0)return a;lll p=1;for(;n>0;n/=2,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
void dout(double d){printf("%.12f\n",d);}

const int iinf = 1e9;
const ll linf = 1e18;
const int mod = 1e9+7;
const double pi = acos(-1);
const double eps = 1e-10;
int n, m, l, r;
ll d;
struct UnionFind{
  vpll p;
  void init(int n){
    p.resize(n);
    FOR(i, 0, n) p[i] = pll(-1, 0);
  }
  pll find(int a){
    if(p[a].fi < 0) return pll(a, 0);
    pll t = find(p[a].fi);
    p[a] = pll(t.fi, t.se+p[a].se);
    return p[a];
  }
  bool merge(int l, int r, ll d){
    pll _l = find(l);
    pll _r = find(r);
    if(_l.fi == _r.fi){
      return _r.se-_l.se == d;
    }else{
      p[_r.fi] = pll(_l.fi, _l.se - _r.se + d);
    }
    return true;
  }
};

UnionFind uf;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> m;
  uf.init(n+1);
  FOR(i, 0, m){
    cin >> l >> r >> d;
    if(!uf.merge(l, r, d)){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}

Measured memory_bytes: 1792
#include "bits/stdc++.h"

using namespace std;

void Main() {
    string S;
    cin >> S;
    int N = S.size();
    int nr = 0;
    int nb = 0;
    for (int i = 0; i < N; ++i) {
        if (S[i] == '0') {
            ++nr;
        }
        else {
            ++nb;
        }
    }
    cout << min(nr, nb) * 2 << endl;
}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3760
#include <bits/stdc++.h>
#define ll long long
#define maxn 100005 /*rem*/
#define mod 998244353
#define db double
#define vi vector<int>
#define pb push_back
using namespace std;
ll ksm(ll a, ll b) {
   if (!b) return 1;
   ll ns = ksm(a, b >> 1);
   ns = ns * ns % mod;
   if (b & 1) ns = ns * a % mod;
   return ns;
}
int n, a[maxn];
ll l, r;
int main() {
	cin >> n;
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	l = r = 2;
	for (int i = n; i >= 1; i--) {
		ll bg = (r / a[i]) * a[i], sm = (l / a[i]) * a[i];
		if (sm < l) sm += a[i];
		l = sm, r = bg + a[i] - 1;
		if (l > r) {
			cout << -1 << endl;
			return 0;
		}
	}
	cout << l << ' ' << r << endl;
	return 0;
}


Measured memory_bytes: 640
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N, M = mi()
Q = li2(M)
#Q = sorted(Q, key=lambda x:x[1])

l = [N]*N
for i in range(M):
    ind = max(0, Q[i][0]-1)
    l[ind] = min(Q[i][1]-1, l[ind])

for i in reversed(range(N-1)):
    l[i] = min(l[i], l[i+1])

cnt = 0
i = 0
#print(l)
while True:
    i = l[i]
    cnt += 1
    if l[i] == N:
        break

print(cnt)


Measured memory_bytes: 31164
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
const long long INF = 1e12;

int main() {
    ll k,a,b;
    cin >> k>>a>>b;
    for (ll i = 0; i < 1500;i++){
        if(a<=i*k&&i*k<=b){
            cout << "OK"<<endl;
            return 0;
        }
    }
    cout << "NG" << endl;
}

Measured memory_bytes: 3624
def Distance(X,Y,p):
    s=0
    for x,y in zip(X,Y):
        s+=abs(x-y)**p
    print(s**(1/p))
    
n=int(input())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))

for p in range(1,4):
    Distance(X,Y,p)
print(max(abs(x-y) for x,y in zip(X,Y)))



Measured memory_bytes: 5648
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cmath>
#include<cstdio>
#include<tuple>
#include<bitset>
#include<map>
#include<atcoder/all>
using namespace atcoder;

using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
#define debug(output) cout<<#output<<"= "<<output<<endl
using ll = long long;
using lint = long long;
typedef pair<int,int> P;
const lint inf=1e18+7;
const int MOD=1000000007;
signed main(){
  int n,m;cin>>n>>m;
  vector<string> s(n);
  rep(i,n)cin>>s[i];
  mf_graph<lint> g(n*m+2);
  auto ind=[=](int a,int b){return a*m+b;};
  rep(i,n){
      rep(j,m){
          if(s[i][j]=='#')continue;
          if((i+j)%2==0){
              g.add_edge(n*m,ind(i,j),1);
          }
          else{
              g.add_edge(ind(i,j),n*m+1,1);
          }
          if(i!=n-1&&s[i+1][j]=='.'){
              int from=ind(i,j);
              int to=ind(i+1,j);
              if((i+j)%2==1){
                  swap(from,to);
              }
              g.add_edge(from,to,1);
          }
          if(j!=m-1&&s[i][j+1]=='.'){
              int from=ind(i,j);
              int to=ind(i,j+1);
              if((i+j)%2==1){
                  swap(from,to);
              }
              g.add_edge(from,to,1);
          }
      }
  }
  lint res=g.flow(n*m,n*m+1);
  auto edges=g.edges();
  for(auto e:edges){
      if(e.from==n*m||e.to==n*m+1)continue;
      if(e.flow==1){
          if(e.from%m+1==e.to%m){
              s[e.from/m][e.from%m]='>';
              s[e.from/m][e.from%m+1]='<';
          }
          if(e.from/m+1==e.to/m){
              s[e.from/m][e.from%m]='v';
              s[e.from/m+1][e.from%m]='^';
          }
          if(e.from%m-1==e.to%m){
              s[e.from/m][e.from%m]='<';
              s[e.from/m][e.from%m-1]='>';
          }
          if(e.from/m-1==e.to/m){
              s[e.from/m][e.from%m]='^';
              s[e.from/m-1][e.from%m]='v';
          }
      }
  }
  cout<<res<<"\n";
  rep(i,n){
      cout<<s[i]<<"\n";
  }
  return 0;
}

Measured memory_bytes: 6292