akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;

int main() {
  ll k, a, b;
  cin >>k >> a >> b;
  bool ans = false;
  repI(i, a, b+1) {
    if (i % k == 0) ans = true;
  }

  if(ans) cout << "OK" << endl;
  else cout << "NG" << endl;


  return 0;
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
int main()
{
 int rows,cols;
  cin>>rows>>cols;
  char input[rows][cols];
    int co=1e9+7;
  for(int i=0;i<rows;i++)
  {
 for(int j=0;j<cols;j++)
   cin>>input[i][j];
  }
  int dp[rows][cols];
  memset(dp,0,sizeof(dp));
dp[rows-1][cols-1]=1;
    for(int i=cols-2;i>=0;i--)
  {
   if(input[rows-1][i]=='.')
    dp[rows-1][i]=dp[rows-1][i+1];
     else
           dp[rows-1][i]=0;
       
  }
    for(int i=rows-2;i>=0;i--)
  {
   if(input[i][cols-1]=='.')
    dp[i][cols-1]=dp[i+1][cols-1];
     else
           dp[i][cols-1]=0;
       
  }
  for(int i=rows-2;i>=0;i--)
  {
   for(int j=cols-2;j>=0;j--)
   {
 if(input[i][j]=='.')
    dp[i][j]=(dp[i+1][j]+dp[i][j+1])%co;
     else
           dp[i][j]=0;
     
   }
  }
   // for(int i=0;i<rows;i++)
   // {
   //     for(int j=0;j<cols;j++)
   //         cout<<dp[i][j]<<" ";
   //     cout<<endl;
   // }
cout<<dp[0][0]<<endl;
}

Measured memory_bytes: 8500
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
//inline int in() { int x; scanf("%d",&x); return x;}
inline ll in() { ll x; cin >> x; return x; }
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;

vector<int> to[2505];
vector<int> rto[2505];
bool reachablefrom1[2505];
bool reachableToN[2505];
bool ok[2505];

void dfs(int v) {
  if (reachablefrom1[v]) return;
  reachablefrom1[v] = true;
  for (int u : to[v]) {
    dfs(u);
  }
}
void rdfs(int v) {
  if (reachableToN[v]) return;
  reachableToN[v] = true;
  for (int u : rto[v]) {
    rdfs(u);
  }
}

int main() {
  int a=in();
  string s; cin>>s;
  if (a>=3200) {
    cout << s << endl;
  } else {
    cout << "red" << endl;
  }
  return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<int,int> P;
const LL mod=1000000007;
const LL LINF=1LL<<60;
const int INF=1<<30;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};


int main(){
    int n;cin >> n;
    vector<LL> a(n);
    LL suma=0,sumb=0;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if(i%2==0) suma+=a[i];
        else sumb+=a[i];
    }
    vector<LL> ans;
    ans.pb(suma-sumb);
    for (int i = 1; i < n; i++) {
        ans.pb(2*a[i-1]-ans[i-1]);
    }
    for (int i = 0; i < n; i++) {
        cout << ans[i] << (i==n-1?"\n":" ");
    }
    return 0;
}


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

int main(){
  int N,a;
  cin >> N;
  int count;
  int t = 100;
  for (int i=0; i < 3; i++){
    a = N / t;
    N = N % t;
    t /= 10;
    if(a==1){
      count++;
    }
  }
  cout << count << endl;
}

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

int main() {
	int n;
	cin >> n;
	vector<int> d(n);
	rep(i,n) cin >> d[i];
	int ans = 0;
	for(int i=0;i<n;i++)
		for (int j=i+1;j<n;j++)
			ans += d[i]*d[j];
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N = sc. nextInt();
  	int n = N;
	int sum = 0; 
	String a = "No";
	while(n > 0) {
		sum += n % 10;
		n /= 10;
	}
	if(N % sum == 0) {
		a = "Yes";
	}
	System.out.println(a);
}
}


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

using namespace std;

string s;
vector<char> v1;

int main () {

    cin >> s;
   
    for (int i = 0; i < s.length(); i++){
        if (s[i] == '0'){
                v1.push_back('0');
            }
            else if (s[i] == '1'){
                v1.push_back('1');
            }
            else if (s[i] == 'B' && !v1.empty()){
                v1.pop_back();
            }
    
    }

    string str1(v1.begin(), v1.end());
    cout << str1 << "\n";

    return 0;

}


Measured memory_bytes: 256
w = input()
count=0
if(w.count("a")%2==0):
    if(w.count("b")%2==0):
        if(w.count("c")%2==0):
            if(w.count("d")%2==0):
                if(w.count("e")%2==0):
                    if(w.count("f")%2==0):
                        if(w.count("g")%2==0):
                            if(w.count("h")%2==0):
                                if(w.count("i")%2==0):
                                    if(w.count("j")%2==0):
                                        if(w.count("k")%2==0):
                                            if(w.count("l")%2==0):
                                                if(w.count("m")%2==0):
                                                    if(w.count("n")%2==0):
                                                        if(w.count("o")%2==0):
                                                            if(w.count("p")%2==0):
                                                                if(w.count("q")%2==0):
                                                                    if(w.count("r")%2==0):
                                                                        if(w.count("s")%2==0):
                                                                            if(w.count("t")%2==0):
                                                                                if(w.count("u")%2==0):
                                                                                    if(w.count("v")%2==0):
                                                                                        if(w.count("w")%2==0):
                                                                                            if(w.count("x")%2==0):
                                                                                                if(w.count("y")%2==0):
                                                                                                    if(w.count("z")%2==0):
                                                                                                        count=1
if(count==1):
    print("Yes")
if(count==0):
    print("No")

Measured memory_bytes: 9236
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		var s=".."+sc.S;
		var h=new int[s.Length+1];
		h[0]=int.MaxValue;
		h[s.Length]=int.MaxValue;
		int p=int.MaxValue;
		for(int i = 2;i<s.Length;i++) {
			if(s[i]=='<'){
				h[i]=h[i-1]+1;
			}
			else{
				h[i]=h[i-1]-1;
			}
			p=Min(p,h[i]);
		}
		for(int i = 1;i<s.Length;i++) {h[i]-=p;}
		var li=new List<int>();
		for(int i = 1;i<s.Length;i++) {
			if(h[i]<h[i-1]&&h[i]<h[i+1]){
				li.Add(i);
			}
		}
		for(int i = 0;i<li.Count;i++) {
			h[li[i]]=0;
			for(int j = li[i]+1;;j++) {
				if(h[j]==int.MaxValue){break;}
				if(h[j]>h[j+1]&&h[j]>h[j-1]){break;}
				h[j]=h[j-1]+1;
			}
			for(int j = li[i]-1;;j--) {
				if(h[j]==int.MaxValue){break;}
				if(h[j]>h[j+1]&&h[j]>h[j-1]){break;}
				h[j]=h[j+1]+1;
			}
		}
		
		long ans=0;
		for(int i = 1;i<s.Length;i++) {
			if(h[i]>h[i+1]&&h[i]>h[i-1]){h[i]=Max(h[i-1],h[i+1])+1;}
			ans+=h[i];
		}
		Console.WriteLine("{0}",ans);
	}
}

public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}

Measured memory_bytes: 17888
#include <bits/stdc++.h>
using namespace std;
int main()
{
    long int n,m,i,ans;
    scanf("%ld %ld",&n,&m);
    if(n<=m/2)
    ans=(n*2+m)/4;
    else
    ans=m/2;
    printf("%ld",ans);
    return 0;
}

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

#define ll long long

using namespace std;

const int N = (int)1e4 + 7;
const int mod = (int)1e9 + 7;

int dp[N][100][2];
int n, d;
int ans = 0;
string k;

int add(int a, int b) {
	return (a + b) % mod;
}

int go(int pos, int sum, int pref) {
	if (pos == n) return sum == 0;
	int &res = dp[pos][sum][pref];
	if (res != -1) return res;
	res = 0;
	if (pref) {
		for (int i = 0; i < min(10, k[pos] - '0' + 1); i++) {
			res = add(res, go(pos + 1, (sum + i) % d, (i == k[pos] - '0')));
		}
	} else {
		for (int i = 0; i < 10; i++) {
			res = add(res, go(pos + 1, (sum + i) % d, 0));
		}
	}
	return res;
}

main() {
	memset(dp, -1, sizeof dp);
	cin >> k;
	scanf("%d", &d);
	n = k.size();
	for (int i = 1; i <= n; i++) {
		if (i == 1) {
			for (int j = 1; j < k[i - 1] - '0' + 1; j++) {
				ans = add(ans, go(i, j % d, (j == k[i - 1] - '0')));
				//cout << go(i, j % d, (j == k[i - 1] - '0')) << ' ' << i << ' ' << j << ' ' << (j == k[i - 1] - '0') << endl;
			}
		} else {
			for (int j = 1; j < 10; j++) {
				ans = add(ans, go(i, j % d, 0));
				//cout << go(i, j % d, 0) << ' ' << i << ' ' << j << ' ' << 0 << endl;
			}
		}
	}
	printf("%d", ans);
}


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

using namespace std;

#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n)　for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
#define Eunique(v) v.erace(unique(all(v)),v.end())
#define pvec(v)　rep(i,v.size()){cout << v[i] << " ";}
#define INF 0x3f3f3f3f
#define mset(m,v) memset(m,v,sezeof(m))
#define mod 1e9 +7;

const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef deque<ll> dll;
typedef pair<ll,ll> P;
ll dx[4] = {1,0,-1,0},dy[4] = {0,1,0,-1};

ll gcd(ll x,ll y)
{
    ll r;
    while((r = x % y) != 0)
    {
        x = y;
        y = r;
    }
    return y;
}

ll lcm(ll x,ll y)
{
    x /= gcd(x,y);
    y /= gcd(x,y);
    return (x*y);
}

int main()
{
    ll y,m,d;
    char c1,c2;
    cin >> y >> c1 >> m >> c2 >> d;
    if(m <= 4)cout << "Heisei" << endl;
    else cout << "TBD" << endl;
    return 0;
}

Measured memory_bytes: 256
// 九九を出すだけ
package main
import (
	"fmt"
	"os"
	"bufio"
)
var out = bufio.NewWriter(os.Stdout)

func main(){
	defer out.Flush()
	for i:=1; i<10; i++{
		for j:=1; j<10; j++{
			fmt.Fprintf(out, "%dx%d=%d\n", i, j, i*j)
		}
	}
}


Measured memory_bytes: 1092
#include <bits/stdc++.h>
#define SZ(x) ((int) (x).size())
using namespace std;

typedef long long i64;

int main() {
    #ifdef LOCAL_RUN
    freopen("task.in", "r", stdin);
    freopen("task.out", "w", stdout);
    //freopen("task.err", "w", stderr);
    #endif // ONLINE_JUDGE
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;

    int m = 100'000;
    vector<int> count(m + 1, 0);
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        count[x]++;
    }

    int cnt2 = 0;
    int ans = 0;
    for (int i = 1; i <= m; ++i) {
        if (!count[i]) {
            continue;
        }
        if (count[i] % 2 == 1) {
            ans += count[i] / 2;
        } else {
            ans += count[i] / 2 - 1;
            cnt2++;
        }
    }
    ans += (cnt2 + 1) / 2;

    cout << n - ans * 2 << '\n';
}


Measured memory_bytes: 640
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;

char a[10], b[10];
int main()
{
	while(~scanf("%s", a))
	{
		scanf("%s", b);
		if(a[0] == b[2] && a[2] == b[0] && a[1] == b[1]) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define ff first
#define ss second
#define P 1000000007
#define in(x, a, b) (a <= x && x < b)

using namespace std;
using ll = long long;
typedef pair<int, int> ii;
typedef vector<ii> vii; 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
const ll inf = 1000000001, INF = (ll)1e18 + 1;

ii pair_up(int a, int b) {
	return {min(a, b), max(a, b)};
}

void solve() {
	int n, k;
	cin >> n >> k;
	
	int tk = (n - 1) * (n - 2) / 2;
	if(k > tk) {
		cout << -1 << endl;
		return;
	}
	
	vvi adj(n, vi(n, 0));
	for(int i = 0; i < n - 1; i++) {
		adj[i][n - 1] = adj[n - 1][i] = 1;
	}
	
	for(int i = 0; i < n - 1 && tk > k; i++)
		for(int j = 0; j < n - 1 && tk > k; j++) {
			if(i == j) continue;
			if(adj[i][j]) continue;
			adj[i][j] = adj[j][i] = 1;
			tk--;
		}
		
	set<ii> ans;
	for(int i = 0; i < n; i++)
		for(int j = 0; j < n; j++) {
			if(i == j) continue;
			if(adj[i][j] == 1) ans.insert(pair_up(i, j));
		}
		
	cout << ans.size() << endl;
	for(ii i : ans) cout << i.ff + 1 << " " << i.ss + 1 << endl;
}

int main() {
	ios_base::sync_with_stdio(false);
	solve();
    return 0;
}

Measured memory_bytes: 3868
h,w=gets.split.map &:to_i;c=10.times.map{gets.split.map &:to_i};10.times{|k|10.times{|i|10.times{|j|w=c[j][k]+c[k][i];c[j][i]=w if c[j][i]>w}}};a=0;h.times{gets.split.map{|t|a+=c[t.to_i][1]if t!='-1'}};p a

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

string getFirstChar(bool bucket[]) {
    for (int i=0; i<26; i++) {
        if (bucket[i] == false) {
            char ans_char = i + 'a';
            string ans = {ans_char};
            return ans;
        }
    }
    return "None";
}

int main() {
    string s;
    cin >> s;
    bool bucket[26];
    for (int i=0; i<26; i++) {
        bucket[i] = false;
    }
    for (int i=0; i<s.size(); i++) {
        bucket[s[i] - 'a'] = true;
    }
    cout << getFirstChar(bucket) << endl;
    return 0;
}

Measured memory_bytes: 512
# 2019/10/14
import sys
input=sys.stdin.readline

n=int(input())
cnt=0
b_a=0
a=0
b=0
for i in range(n):
    s=input().rstrip('\n')
    cnt+=s.count('AB')
    is_b=s[0]=='B'
    is_a=s[-1]=='A'
    if is_b or is_a:
        if is_b and is_a:b_a+=1
        elif is_b:b+=1
        else:a+=1
    


if b_a:
    cnt+=b_a-1
    if a==b and a>0:
        a-=1;b-=1
        cnt+=2
    else:
        if abs(a-b)>0:
            cnt+=1
cnt+=min(a,b)

print(cnt)

Measured memory_bytes: 3064
n, m, c=map(int, input().split())
b = list(map(int, input().split()))
a = []
for i in range(n):
    a.append(list(map(int, input().split())))

ab=0
ans=0
for i in range(n):
    for j in range(m):
        ab+=a[i][j]*b[j]
    if ab+c>0:
        ans+=1
        ab = 0
    else:
         ab = 0
print(ans)

Measured memory_bytes: 3064
N = int(input())
S = input()
third = [[[False]*10 for _ in range(10)] for __ in range(10)]
second = [[False]*10 for _ in range(10)]
first = [False]*10
for s in S:
    s = int(s)
    for i in range(10):
        if first[i]:
            for j in range(10):
                if second[i][j]:
                    third[i][j][s] = True
            second[i][s] = True
    first[s] = True

res = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            if third[i][j][k]:
                # print(i, j, k)
                res += 1
print(res)


Measured memory_bytes: 9116
/*bismillah ->                                                                                                         << Suirkhanov Meyirlan >>
  GL HF


                                                                                                                      42

    bless my code =)
                                                                                                            NEVER FOLLOW YOUR RULES :D HAHAHAHA
*/


///scanf ("%d%d", &x, &y);
///printf("%d", &a)

#include <bits/stdc++.h>

#define fast ios_base::sync_with_stdio();   cin.tie(0);   cout.tie(0);
#define randoperation srand(time(0));
#define pii pair < int , int >
#define pll pair < ll, ll >
#define pb push_back
#define pf psuh_front
#define mp make_pair
#define fi first
#define se second
#define fast ios_base::sync_with_stdio();   cin.tie(0);   cout.tie(0);
#define randoperation srand(time(0));
#define eb emplace_back

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const ll N = 2 * 1e3 + 7;
const ld pi = 3.14159265359;
const int INF = 1e20 + 7;
const double eps = 1e-9;

const int xi[4] = {-1, 0, +1, 0};
const int yj[4] = {0, +1, 0, -1};
const int xxi[4] = {+1, 0, -1, 0};
const int yyj[4] = {0, -1, 0, +1};

int n, l;

string s[N];

int main(){

  //freopen("bridge.in", "r", stdin);
  //freopen("bridge.out", "w", stdout);

  fast
  randoperation;

  ///           ||
  ///start here \/

  cin >> n >> l;

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

  sort(s + 1, s + 1 + n);

  for(int i = 1; i <= n; i++){
    cout << s[i];
  }
}


Measured memory_bytes: 256
ACGT = %w[A C G T].freeze

def main s
  ans = 0
  count = 0
  s.each_char.to_a.map do |c|
    if ACGT.include? c
      count += 1
      ans = count if ans < count
    else
      count = 0
    end
  end

  ans
end

s = gets.chomp
puts main(s)

Measured memory_bytes: 1788
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef complex<double> com;
const int mod = 1e9 + 7;
const int MOD = 998244353;
const int inf = 2e9;
ll mpow(ll a, ll b) { ll r = 1; a %= mod; while (b) { r = r * ((b % 2) ? a : 1) % mod, a = a * a % mod, b >>= 1; }return r; }



int main() {
	int n; cin >> n;
	double ll = inf, lm = inf, lr = inf;
	double rl = -inf, rm = -inf, rr = -inf;
	double dd = inf, dm = inf, du = inf;
	double uu = -inf, um = -inf, ud = -inf;
	rep(i, 0, n) {
		double x, y; cin >> x >> y;
		string s; cin >> s;
		if (s == "U") {
			lm = min(lm, x);
			rm = max(rm, x);
			du = min(du, y);
			uu = max(uu, y);
		}
		if (s == "D") {
			lm = min(lm, x);
			rm = max(rm, x);
			dd = min(dd, y);
			ud = max(ud, y);
		}
		if (s == "L") {
			ll = min(ll, x);
			rl = max(rl, x);
			dm = min(dm, y);
			um = max(um, y);
		}
		if (s == "R") {
			lr = min(lr, x);
			rr = max(rr, x);
			dm = min(dm, y);
			um = max(um, y);
		}
	}
	long double ans = 1LL * inf * inf;
	rep(i, 0, 4e8) {
		double t = i / 2.0;
		double xmin = min({ lm,ll - t,lr + t });
		double xmax = max({ rm,rl - t,rr + t });
		double ymin = min({ dm,dd - t,du + t });
		double ymax = max({ um,ud - t,uu + t });
		ans = min(ans, (long double)(xmax - xmin) * (ymax - ymin));
	}
	printf("%.12Lf", ans);
	return 0;
}


Measured memory_bytes: 384
#include "bits/stdc++.h"
using namespace std;

const int INF=1e9+5;

int main()
{
    int n;
    cin>>n;
    int k;
    cin>>k;
    vector<int>h(n);
    for(int i=0;i<n;i++)
    {
        cin>>h[i];
    }
    vector<int>dp(n,INF);
    dp[0]=0;
    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j<=i+k;j++)
        {
            if(j<n)
            dp[j]=min(dp[j],dp[i]+abs(h[j]-h[i]));
        }
    }
    cout<<dp[n-1];
	return 0;
}

Measured memory_bytes: 1024
A = list(map(int, input().split()))
 
M = A[0]
D = A[1]
count = 0
 
for i in range(4,M+1):
  for j in range(22,D+1):
    day = list(str(j))
    m10 = int(day[0])
    m1 = int(day[1])
    if m10 < 2:
      continue
    elif m1 < 2:
      continue
    
    if i == m10 * m1:
      count+=1
    
  
 
print(count)

Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<algorithm>
#include<cmath>
#include<string>
#include<functional>
#include<unordered_set>
using namespace std;
#define ms(x,y) memset(x, y, sizeof(x))
#define lowbit(x) ((x)&(-x))
#define sqr(x) ((x)*(x))
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;
#define endl "\n";

const int maxn = 5e5+7;

LL a[maxn][26];

void add(int pos, int ch, int val) {
    for(;pos<maxn;pos+=lowbit(pos))
        a[pos][ch] += val;
}

LL getsum(int pos, int ch) {
    LL ret = 0;
    for(;pos; pos -= lowbit(pos))
        ret += a[pos][ch];
    return ret;
}

void run_case() {
    int n, q; string s;
    cin >> n >> s >> q;
    for(int i = 0; i < n; ++i) {
        add(i+1, s[i]-'a', 1);
    }
    while(q--) {
        static int type;
        cin >> type;
        if(type == 1) {
            static int pos;
            static char ch;
            cin >> pos >> ch;
            add(pos, s[pos-1]-'a', -1);
            s[pos-1] = ch;
            add(pos, ch-'a', 1);
        } else {
            static int l, r;
            cin >> l >> r;
            int ans = 0;
            for(int i = 0; i < 26; ++i) 
                ans += ((getsum(r, i)-getsum(l-1,i))>0?1:0);
            cout << ans << endl;
        }
    }
}


int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    cout.flags(ios::fixed);cout.precision(9);
    //int t; cin >> t;
    //while(t--)
    run_case();
    cout.flush();
    return 0;
}

Measured memory_bytes: 102556
import collections

N, M = map(int, input().split())
AB = []
for m in range(M):
    a, b = map(int, input().split())
    AB.append((a, b))

Cost = [[] for l in range(N+1)]
R = [0]*(N+1)
#print(Cost)

for a, b in AB:
    Cost[a].append(b)
    Cost[b].append(a)

#print(AB)
#print(Cost)

Rcount = 0
Pipod = collections.deque()
Pipod.append(1)
while Rcount != N-1:
    #print(Pipod)
    p = Pipod.popleft()
    #print(Cost[p])
    for c in Cost[p]:
        if c != 1 and R[c] == 0:
            R[c] = p
            Pipod.append(c)
            Rcount += 1
    if len(Pipod) == 0:
        print('No')
        exit(0)

print('Yes')
for x in R[2:N+1]:
    print(x)

Measured memory_bytes: 49020
import java.io.*;
import java.util.*;

public class Main {

	static int N = 0;
	static int[] TA = new int[2];
	static int[] H;
	
	public static void main(String[] args) throws Exception {
		try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
			N = Integer.parseInt(br.readLine());
			TA = getArray(br.readLine());
			H = getArray(br.readLine());
		}
		
		double[] temps = Arrays.stream(H).mapToDouble(n -> Math.abs(TA[1] - (TA[0] - n * 0.006))).toArray();
		int min = 0;
		for(int i=0; i<temps.length; i++) {
			if(temps[i] < temps[min]) min = i;
		}
		System.out.println(min+1);
		
	}
	
	static int[] getArray(String s) {
		return Arrays.stream(s.split(" ")).mapToInt(Integer::parseInt).toArray();
	}

	
}


Measured memory_bytes: 27604
#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<vector>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<bitset>
#include<math.h>
using namespace std;
using ll = int64_t;
using Graph = vector<vector<int> >;
const ll M = 1000000007;

int main(){
    string s;
    cin >> s;
    if(s.at(s.size()-1)=='s'){
        s.push_back('e');
        s.push_back('s');
    }else{
        s.push_back('s');
    }

    cout << s << endl;
}

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

int left(int i){ return i*2; }

int right(int i){ return i*2 + 1; }

void swap(int *x, int *y){
  int tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}

int n;

void maxHeapify(int *arr, int i){
  int largest;
  int l = left(i), r = right(i);

  // choice largest key in this and parents
  if(l <= n && arr[l] > arr[i]) largest = l;
  else largest = i;
  if(r <= n && arr[r] > arr[largest]) largest = r;

  if(largest != i){ // if arr[i]'s parent key larger than arr[i]'s key
    swap(&arr[i], &arr[largest]);
    maxHeapify(arr, largest);
  }
}

void buildMaxHeap(int *arr){
  int i;
  for(i=n/2; i>=1; i--) maxHeapify(arr, i);
}

int main(void){
  int i;
  int *heap;

  // input and alloc
  scanf("%d", &n);
  heap = (int *)malloc(sizeof(int) * n);
  for(i=1; i<=n; i++) scanf("%d", &heap[i]);

  // build heap
  buildMaxHeap(heap);

  // output
  for(i=1; i<=n; i++) printf(" %d", heap[i]);
  printf("\n");

  return 0;
}

Measured memory_bytes: 2980
import * as fs from "fs";

let [N_str, A_str] = fs.readFileSync("/dev/stdin", "utf8").trim().split('\n');

let N: number = Number(N_str);
let A: number[] = A_str.split(' ').map((value, index) => {return Number(value)-(index+1);});
A.sort((a, b) => {return a-b;});

function f(b: number): number {
    return A.reduce((prev, current) => {return prev+Math.abs(current-b)}, 0);
}

console.log(f(A[Math.floor(N/2)]));


Measured memory_bytes: 53540
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>

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

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

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int r,g,b,n;
  cin>>r>>g>>b>>n;
  int res=0;
  rep(i,n/r+1)
  {
    rep(j,(n-i*r)/g+1)
    {
      if((n-i*r-j*g)%b==0)res++;//cout<<i<<j<<endl;}

    }
  }

  cout<<res<<endl;

  return 0;

}


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

using namespace std;

int main()
{
	double max,min;
	double hei;
	int flag=1;

	max=0;
	while(scanf("%lf",&hei)!=EOF){
		if(flag){
			min=hei;
			flag=0;}
		if(max<hei)
			max=hei;
		else if(min>hei)
			min=hei;
	}
	printf("%.1lf\n",max-min);
	return 0;
}

Measured memory_bytes: 1236
// D - Add and Remove
#include <bits/stdc++.h>

using namespace std;

long long dfs(const vector<long long> &a, int l, int r, long long lc, long long rc)
{
	if (r - l <= 0) return 0;
	long long best = 1e18;
	for (int m = l; m < r; m++) {
		long long s = a[m] * (lc + rc) + dfs(a, l, m, lc, lc + rc) + dfs(a, m + 1, r, lc + rc, rc);
		best = min(best, s);
	}
	return best;
}

int main(int argc, char *argv[])
{
	ios::sync_with_stdio(false); cin.tie(0);
	int n;
	cin >> n;
	vector<long long> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	cout << dfs(a, 1, n - 1, 1, 1) + a[0] + a[n - 1] << endl;
	return 0;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))

M = []

# M0を求める
m0 = 0
oper = 1
for a in A:
  m0 += oper * a
  oper = -1 * oper
#print(m0)
M.append(m0)

# ひとつ前の結果を用いて簡易に求められる
for i in range(1, N):
  mi = (-1 * M[-1]) + (2 * A[i-1])
  M.append(mi)
#print(M)

ans = ' '.join(str(m) for m in M)
print(ans)

Measured memory_bytes: 19144
#include<cstdio>
#include<cstring>
#include<queue>
#include<vector>
using namespace std;
#define INF 1000000000
#define pb push_back
#define maxn 10001
struct Edge{
	int from, to, dist, cost;
};
struct HeapNode{
	int d, u, c;
	bool operator < (const HeapNode& a)const{
		if(d==a.d)	return c>a.c;
		return d>a.d;
	}
};
inline void IN(int& x){
	x=0;
	char c=getchar();
	while(c<48 || c>57)	c=getchar();
	while(c>=48 && c<=57){
		x=x*10+c-48;
		c=getchar();
	}
}
int n, m;
vector<Edge> edges;
vector<int> G[maxn];
vector<int> V[maxn];
bool done[maxn];
int d[maxn], p[maxn], c[maxn];
int ans;
void init(){
	for(int i=1; i<=n; i++){
		G[i].clear();
		V[i].clear();
	}
	edges.clear();
}
void add(int from, int to, int dist, int cost){
	edges.pb((Edge){from, to, dist, cost});
	m = edges.size();
	G[from].pb(m-1);
	V[from].pb(cost);
}
void dijkstra(int s){
	ans=0;
	priority_queue<HeapNode> Q;
	for(int i=1; i<=n; i++)	d[i]=INF;
	for(int i=1; i<=n; i++)	c[i]=INF;
	d[s]=0;
	c[s]=0;
	memset(done, 0, sizeof(done));
	Q.push((HeapNode){0,s,0});
	while(!Q.empty()){
		HeapNode x = Q.top(); Q.pop();
		int u=x.u;
		if(done[u])	continue;
		done[u]=1;
		ans += c[u];
		for(int i=0; i<G[u].size(); i++){
			Edge& e = edges[G[u][i]];
			if(d[e.to]>d[u]+e.dist || (d[e.to]==d[u]+e.dist && c[e.to]>V[u][i])){
				d[e.to] = d[u]+e.dist;
				p[e.to] = G[u][i];
				c[e.to] = V[u][i];
				Q.push((HeapNode){d[e.to],e.to,c[e.to]});
			}
		}
	}
	printf("%d\n", ans);
}
int k;
int main(){
	while(1){
		IN(n); IN(k);
		if(!n && (!k))	break;
		int a, b, c, d;
		init();
		while(k--){
			IN(a); IN(b); IN(c); IN(d);
			add(a, b, c, d);
			add(b, a, c, d);
		}
		dijkstra(1);
	}
	return 0;
}

Measured memory_bytes: 3548
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<cmath>
#include<set>
using namespace std;
typedef pair<int64_t,int64_t> P;
typedef pair<int64_t,P> T;
vector<P> G[4001];
int64_t ans[4001][4001]={};
class uft {//union-find tree
public:
    int parent[4010];
    int size[4010];
    int root(int x);
    bool same(int x,int y);
    void unite(int x,int y);
};
int uft::root(int x){
    if(parent[x]==x){
        return x;
    }
    return parent[x] = root(parent[x]);
}
bool uft::same(int x,int y){
    if(root(x)==root(y)){
        return true;
    }else{
        return false;
    }
}
void uft::unite(int x,int y){
    x=root(x);
    y=root(y);
    if(x == y) return;
    parent[x] = y;
    size[y] = size[y]+size[x];
}
int64_t Kruskal(priority_queue<T, vector<T>, greater<T> > q,int N){
    uft u;
    for(int i=0;i<N;i++){
        u.parent[i]=i;
        u.size[i]=1;
    }
    int64_t ret=0;
    while(u.size[u.root(0)] != N && !q.empty()){
        T edge = q.top(); q.pop();
        int s=(edge.second).first;
        int t=(edge.second).second;
        if(u.root(s) != u.root(t) ){
            u.unite(s,t);
            ret += edge.first;
            G[s].push_back(P(t,edge.first));
            G[t].push_back(P(s,edge.first));
            //cout<<s<<' '<<t<<' '<<edge.first<<endl;
        }
    }
    return ret;
}

int main(){
    int N,M;
    cin>>N>>M;
    priority_queue<T, vector<T>, greater<T> > q;
    for(int i=0;i<M;i++){
        int a,b;
        int64_t c;
        cin>>a>>b>>c;
        a--; b--;
        T d = T(c,P(a,b));
        q.push(d);
    }
    int64_t an=Kruskal(q,N);
    //cout<<an<<endl;
    for(int i=0;i<N;i++){
        bool used[4010]={};
        used[i]=true;
        queue<P> qu;
        qu.push(P(i,0));
        while (!qu.empty()) {
            P v  = qu.front(); qu.pop();
            //cout<< v.first <<' '<< v.second <<endl;
            for(int j=0;j<G[v.first].size();j++){
                P u = G[v.first][j];
                if(!used[u.first]){
                    //cout<<v.first<<' '<<v.second<<' '<<u.first<<' '<<u.second<<endl;
                    used[u.first]=true;
                    ans[i][u.first]=max(v.second,u.second);
                    //cout<<"ans "<<i<<' '<<u.first<<' '<<ans[i][u.first]<<endl;cout<<endl;
                    qu.push(P(u.first,ans[i][u.first]));
                }
            }
        }
    }/*
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            cout<<ans[i][j]<<' ';
        }cout<<endl;
    }*/
    int Q;
    cin>>Q;
    for(int i=0;i<Q;i++){
        int s,t;
        cin>>s>>t;
        s--;t--;
        cout<< an - ans[s][t] << endl;
    }
    
    
    return 0;
}


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

int main(){
    int a, b, x;
    cin >> a >> b >> x;

    if(a + b < x || a > x){
        cout << "NO" << endl;
    }else{
        cout << "YES" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <cctype>
using namespace std;
typedef long long lint;
#define cout cerr
#define ni (next_num<int>())
template<class T>inline T next_num(){
	T i=0;char c;
	while(!isdigit(c=getchar())&&c!='-');
	bool flag=c=='-';
	flag?c=getchar():0;
	while(i=i*10-'0'+c,isdigit(c=getchar()));
	return flag?-i:i;
}
template<class T1,class T2>inline void apmax(T1 &a,const T2 &b){if(a<b)a=b;}
template<class T1,class T2>inline void apmin(T1 &a,const T2 &b){if(b<a)a=b;}
const int N=100010;
int gcd(int a,int b){
	return b?gcd(b,a%b):a;
}
int a[N],n;
bool Main(){
	if(n==1)return (a[1]&1)==0;
	int cnt[2]={0,0};
	bool hasone=false;
	for(int i=1;i<=n;i++){
		cnt[a[i]&1]++;
		hasone|=a[i]==1;
	}
	if(hasone)return cnt[0]&1;
	if(cnt[0]&1)return true;
	if(cnt[1]>1)return false;
	assert(cnt[1]==1);
	int g=0;
	for(int i=1;i<=n;i++){
		if(a[i]&1){
			a[i]--;
		}
		g=gcd(g,a[i]);
	}
	for(int i=1;i<=n;i++){
		a[i]/=g;
	}
	return !Main();
}
int main(){
	n=ni;
	for(int i=1;i<=n;i++){
		a[i]=ni;
	}
	puts(Main()?"First":"Second");
	return 0;
}

Measured memory_bytes: 640
var stdin = require("fs").readFileSync("/dev/stdin", "utf8");
stdin = stdin.trim().split("\n");
var stdout = [];
function print(x){stdout.push(x)};


var menu = stdin.map(n=>parseInt(n));
var dmin = 9
var ans = 0
for (i=0; i < 5; i++){
    dmin = Math.min((menu[i]-1) % 10, dmin)
    ans += parseInt((menu[i]+9)/10) * 10
}

print(ans - 10 + dmin + 1);


stdout = stdout.join("\n");
console.log(stdout);

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

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

using namespace std;
using lint=long long;

const lint INF=1LL<<61;

int main(){
	int n,k; scanf("%d%d",&n,&k);
	pair<int,int> a[100000];
	rep(i,n) scanf("%d%d",&a[i].second,&a[i].first), a[i].second--;

	sort(a,a+n,greater<pair<int,int>>());

	lint sum1[100001]={};
	rep(i,n) sum1[i+1]=sum1[i]+a[i].first;

	lint ans=0;
	vector<pair<int,lint>> S={{-1,0}};
	int idx=0;
	bool used[100000]={};
	for(int i=1;i<=k;i++){
		for(;idx<n;idx++){
			if(!used[a[idx].second]){
				used[a[idx].second]=true;
				S.emplace_back(idx,S.back().second+a[idx].first);
				break;
			}
		}
		if(idx==n) break;

		int lo=0,hi=k;
		while(hi-lo>1){
			int mi=(lo+hi)/2;
			int d=S.end()-upper_bound(S.begin(),S.end(),make_pair(mi,INF));
			if(mi+1+d<=k) lo=mi;
			else          hi=mi;
		}

		auto it=upper_bound(S.begin(),S.end(),make_pair(lo,INF));
		lint sum2=S.back().second-((--it)->second);

		ans=max(ans,sum1[lo+1]+sum2+1LL*i*i);
	}
	printf("%lld\n",ans);

	return 0;
}


Measured memory_bytes: 3064
# Problem https://atcoder.jp/contests/abc088/tasks/abc088_a
# Ruby 3rd Try
yes = "Yes"
no = "No"
N = gets.chomp('\n').to_i
A = gets.chomp('\n').to_i
oneYenUse = N % 500
if A < oneYenUse
    answer = no
else
    answer = yes    
end
puts(answer)

Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define _GLIBCXX_DEBUG
static const int MAX = 20;


int main(){
  int N, D, ans;
  cin >> N >> D;
  rep2(i, 1, N+1){
    if((2*D+1)*i >= N){
      ans = i;
      break;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
module Vector =
  struct
    type t = { x: float; y: float }
    let eps = 1e-10
    let set x y = {x = x; y = y}
    let add v1 v2 = {x = v1.x +. v2.x; y = v1.y +. v2.y}
    let sub v1 v2 = {x = v1.x -. v2.x; y = v1.y -. v2.y}
    let mul v a = {x = v.x *. a; y = v.y *. a}
    let div v a = {x = v.x /. a; y = v.y /. a}
    let norm v = v.x *. v.x +. v.y *. v.y
    let abs v = sqrt (norm v)
    let dot v1 v2 = v1.x *. v2.x +. v1.y *. v2.y
    let cross v1 v2 = v1.x *. v2.y -. v1.y *. v2.x
  end

let _ =
  try
    while true do
      let v1, v2 = Scanf.scanf "%f %f %f %f %f %f %f %f\n" (fun xa ya xb yb xc yc xd yd -> (Vector.sub (Vector.set xb yb) (Vector.set xa ya)), (Vector.sub (Vector.set xd yd) (Vector.set xc yc))) in
      Printf.printf "%s\n" (if abs_float (Vector.dot v1 v2) < Vector.eps then "YES" else "NO")
    done
  with
    End_of_file -> ()

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

using namespace std;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);

	string s;
	cin >> s;

	if(s[0] == 'S') cout << "Cloudy";
	else if(s[0] == 'C') cout << "Rainy";
	else cout << "Sunny";

	return 0;
} 

Measured memory_bytes: 256
def resolve():
    n,a,b = map(int, input().split())
    if a ==0:
        print(0)
    else:
        ans=0
        tmp = n //(a+b)
        ans += a*tmp
        if n - (a+b)*tmp >a :
            ans +=a
        else:
            ans += n - (a+b)*tmp
        
        print(ans)

if __name__ == "__main__":
    resolve()

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i=(a); i<(b); i++)

int main() {
  int N;
  cin >> N;
  int a = 1;
  int ans = a;
  while (a <= N) {
    ans = a;
    a *= 2;
  }
    
  cout << ans << endl;

return 0;
}

Measured memory_bytes: 3608
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;

ll dfs(ll x, bool a, bool b, bool c, ll n) {
	if( x > n ) return 0;
	
	ll res = 0;
	
	if( x <= n && x != 0 && a && b && c ) res++;
	
	res += dfs(10 * x + 3, true, b, c, n);
	res += dfs(10 * x + 5, a, true, c, n);
	res += dfs(10 * x + 7, a, b, true, n);
	
	return res;
}

int main(void) {
	ll n;
	cin >> n;
	
	ll ans = dfs(0LL, false, false, false, n);
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;


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

	long long n, i, j, k, ans, c1, c2;
	cin >> n;
	vector<long long> a(n), b(n, 0), c(n, 0);
	for (i = 0; i < n; i++) cin >> a[i];
	
	sort(a.begin(), a.end());
	c1 = 0; c2 = 0;
	for (i = 1; i < n; i++) {
		if (i % 2 == 1) b[i]++, b[i - 1]--;
		else b[i - 1]++, b[i]--;

		if (i % 2 == 1) c[i]--, c[i - 1]++;
		else c[i - 1]--, c[i]++;
	}
	sort(b.begin(), b.end());
	sort(c.begin(), c.end());
	c1 = 0; c2 = 0;
	for (i = 0; i < n; i++) {
		c1 += a[i] * b[i];
		c2 += a[i] * c[i];
	}


	ans = max(c1, c2);
	cout << ans << "\n";
		
	return 0;
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
    ll k;
   cin>>k;
   string s;
   cin>>s;

   ll n=s.length();
   if(n<=k)
   {
       cout<<s;
   }
   else
   {
       string new_s="";
       for(int i=0;i<k;i++)
       {
           new_s+=s[i];
       }
       new_s+='.';
       new_s+='.';
       new_s+='.';
       cout<<new_s;
   }
}


Measured memory_bytes: 3632
#include <algorithm>
#include <iostream>
#include <limits>
#include <utility>
#include <vector>

using namespace std;


int main() {
  long N, W;
  cin >> N >> W;
  
  vector<pair<long, long>> weight_values;
  weight_values.reserve(N);
  for (size_t n = 0; n < N; ++n) {
    long w, v;
    cin >> w >> v;
    weight_values.push_back(make_pair(w, v));
  }

  vector<vector<long>> dp(N+1, vector<long>(100001, -1));
  for (vector<long>& vec : dp) vec[0] = 0;

  long ans = 0;
  for (size_t n = 0; n < N; ++n) {
    for (long v = 1; v <= 100000; ++v) {
      long w = W + 1;
      if (weight_values[n].second <= v) {
        long pre = dp[n][v - weight_values[n].second];
        if (pre != -1) {
          long preval = numeric_limits<long>::max();
          if (dp[n][v] != -1) preval = dp[n][v];
    	  w = min(preval, pre + weight_values[n].first);
        } 
      }
      if (w == W +1 && dp[n][v] != -1) {
        w = dp[n][v];
      }
      if (w <= W) {
        ans = max(ans, v);
        dp[n+1][v] = w; 
      }
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 80256
/*#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <stack>
#include <functional>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <numeric>
*/
#include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define rrep()
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;

int main(){
    vector<double> v;
    double x;
    while(cin>>x)v.pb(x);
    Sort(v);
    cout<<v[v.size()-1]-v[0]<<endl;
    
    return 0;
}



Measured memory_bytes: 3288
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define int long long
#define inf 1000000007
#define LINF 100000000000000007LL
#define ll long long
using namespace std;
int mi[114514],ma[114514];
signed main(){
	int n;
	cin>>n;
	vector<int> tak(n), aok(n);
	for(int i=0;i<n;i++){
		cin>>tak[i];
	}
	for(int i=0;i<n;i++){
		cin>>aok[i];
	}
	for(int i=0;i<n;i++){
		mi[i] = 1;
		ma[i] = inf;
	}
	for(int i=0;i<n;i++){
		if( i == 0 || tak[i-1] < tak[i] ){
			mi[i] = max( mi[i], tak[i] );
			ma[i] = min( ma[i], tak[i] );
		}
		else{
			ma[i] = min(ma[i], tak[i]);
		}
	}
	for(int i=n-1;i>=0;i--){
		if( i == n-1 || aok[i+1] < aok[i] ){
			mi[i] = max( mi[i], aok[i] );
			ma[i] = min( ma[i], aok[i] );
		}
		else{
			ma[i] = min( ma[i] , aok[i]);
		}
	}
	int ans = 1;
	for(int i=0;i<n;i++){
		//cout<<mi[i]<<" "<<ma[i]<<endl;
		ans *= max( 0LL, ma[i]-mi[i]+1);
		ans %= inf;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3328
from collections import Counter
from math import factorial

N = int(input())
A = list(map(int, input().split()))
memo = [0]*(N+1)
for i in range(1, N+1):
    memo[i] = memo[i-1] + A[i-1]

cnt = 0
C = Counter(memo)

for c in C.values():
    if c > 1:
        cnt += (factorial(c)/(2*factorial(c-2)))

print(int(cnt))

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

int main() {
	string s, t;
	cin >> s >> t;
	int n = s.size();
	int st[26], ts[26];
	fill(begin(st), end(st), -1);
	fill(begin(ts), end(ts), -1);
	bool ans = true;
	for (int i = 0; i < n; i++) {
		int si = s[i] - 'a', ti = t[i] - 'a';
		if (st[si] != -1 && st[si] != ti) {
			ans = false;
			break;
		}
		if (ts[ti] != -1 && ts[ti] != si) {
			ans = false;
			break;
		}
		st[si] = ti;
		ts[ti] = si;
	}
	if (ans) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 3460
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<utility>
#include<set>
#include<stack>
#include<list>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cstring>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<cmath>
#include<cctype>


#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)
#define ff first
#define ss second
#define pll pair<long long int,long long int>
#define pii pair<int,int>
#define vll vector<long long int>
#define vii vector<int>
#define gi(n) scanf("%d",&n)
#define gll(n) scanf("%lld",&n)
#define gstr(n) scanf("%s",n)
#define gl(n) cin >> n
#define oi(n) printf("%d",n)
#define oll(n) printf("%lld",n)
#define ostr(n) printf("%s",n)
#define ol(n) cout << n
#define os cout<<" "
#define on cout<<"\n"
#define o2(a,b) cout<<a<<" "<<b
#define all(n) n.begin(),n.end()
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;
typedef vector<vector<ll> > mat;
int d[100005];vii v[100005];
int main()
{ios_base::sync_with_stdio(false);
int n;
gl(n);

rep(i,1,n)d[i]=1e9;


priority_queue<pii> q;

rep(i,1,n-1)
{
	int a,b;
	cin>>a>>b;
	v[a].pb(b);
	v[b].pb(a);
}
int m;
cin>>m;
while(m--)
{
	int a,b;
	cin>>a>>b;
	d[a]=b;
	q.push(mp(b,a));
}

while(!q.empty())
{
	int at=q.top().ss,dd=q.top().ff;
	q.pop();
	tr(v[at],it)
	{
		if(d[*it]>1e8)
		{
			d[*it]=dd-1;
			q.push(mp(dd-1,*it));
		}
	}
}

rep(i,1,n)
{
	tr(v[i],it)
	{
		if(abs(d[i]-d[*it])!=1)
		{
			ol("No");
			return 0;
		}
	}
}

ol("Yes\n");
rep(i,1,n)
{
	ol(d[i]);on;
}


return 0;
}


Measured memory_bytes: 7924