akhauriyash/Code-Regression huggingface dataset:
//This disgusting code is wriiten by Juruo D0zingbear
//Please don't hack me! 0v0 <3
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <cstring>
#include <climits>
#include <string.h>
#include <stdio.h>
#define LL long long
#define all(x) (x).begin(),(x).end()
#define pii pair<int,int>
#define piii pair<int, pii >
#define REP(i,n) for (int (i)=0;(i)<(n);(i)++)
#define vi vector<int>
#define vpi vector< pii >
#define INF 2147483647
#define big 19260817
#define pb push_back
#define mp make_pair
using namespace std;
const int Maxk=1005;
string mul(string a,string b){
	int res[Maxk];
	memset(res,0,sizeof(res));
	reverse(a.begin(),a.end());
	reverse(b.begin(),b.end());
	for (int i=0;i<a.length();i++){
		for (int j=0;j<b.length();j++){
			res[i+j]+=(a[i]-'0')*(b[j]-'0');
		}
	}
	for (int i=0;i<Maxk;i++){
		if (res[i]>=10) {
			res[i+1]+=(res[i]/10);
			res[i]%=10;
		}
	}
	string ret;
	bool flag=false;
	for (int i=Maxk-1;i>=0;i--){
		if (flag || res[i]){
			flag=true;
			ret=ret+(char)(res[i]+'0');
		}
	}
	if (ret=="") ret="0";
	return ret;
}
string add(string a,string b){
	if (a.length()<b.length()) swap(a,b);
	while (a.length()!=b.length()){
		b='0'+b;
	}
	for (int i=a.length()-1;i>=0;i--){
		a[i]+=(b[i]-'0');
		if (a[i]>'9' && i){
			a[i]-=10;
			a[i-1]++;
		}
	}
	if (a[0]>'9'){
		a[0]-=10;
		a='1'+a;
	}
	return a;
}

// cf IO: I64d
// atcoder IO: ｌｌｄ
inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
	return x * f;
}
const int Maxn=100005;
vector<int> a;
vector<int> b;
int main(){
	int n;
	scanf("%d",&n);
	for (int i=0;i<n;i++){
		int x;
		scanf("%d",&x);
		a.pb(x);
	}
	sort(a.begin(),a.end());
	for (int i=a.size()-1;i>=0;i--){
		if (a[i]==a[i-1]){
			i--;
			b.pb(a[i]);
		}
	}
	long long ans;
	if (b.size()<2){
		ans=0LL;
		printf("%lld\n",ans);
	}
	else{
		ans=(LL)b[0]*(LL)b[1];
		printf("%lld\n",ans);
	}
}

Measured memory_bytes: 1144
#include <cstdio>
#include <algorithm>
#include <cmath>

using ll = long long;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
template<class T>bool CHMAX(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool CHMIN(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
#define REP(i, n) for(ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)


int main() {
	ll n,k;
	scanf("%lld", &n);
	scanf("%lld", &k);
	ll sum=0;
	FOR(i, k, n+1) {
		sum += (2 * n - i + 1) * i / 2 - (i - 1) * i / 2 + 1;
	}
	ll res = sum % MOD;
	printf("%lld\n", res);
	return(0);
}

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

#define INF 100000000
#define ll long long
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,m,n) for(int i=m;i<n;i++)

int main() {
  ll N,A,B,C,D,E;
  cin >> N >> A >> B >> C >> D >> E;
  ll minv = min(A,min(B,min(C,min(D,E))));
  
  if(N%minv == 0) N /= minv;
  else N = (N+minv)/minv;
  
  cout << N+4 << endl;
}

Measured memory_bytes: 256
/// awoooooo

# include <bits/stdc++.h>
# define sz(x) (int)((x).size())

using namespace std;

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

const int N = (int)2e5 + 5;
const int inf = (int)1e9 + 7;

int a, b;

int main(){
  scanf("%d %d", &a, &b);
  if(a <= 0 && 0 <= b){
    printf("Zero\n");
  } else if(a > 0 || (b - a + 1) % 2 == 0){
    printf("Positive\n");
  } else{
    printf("Negative\n");
  }
  return 0;
}


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

int main() {

  string a, b;
  cin >> a >> b;
  int c = stoi(a+b);
  int ans = 1;

  for (int i = 0; i <= 10000; i++) {
      if(c==i*i) {
        ans = 0;
        break;
      }
  }
  
  cout << (ans == 0 ? "Yes" : "No") << endl;
  
}

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

char chess(int h, int w){
    if((h+w)%2 == 0){
        return '#';
    }
    return '.';
}
int main(void)
{
    int H, W;
    while(true){
        cin >> H >> W;
        if (H == 0 && W == 0){
            break;
        }
        for(int i = 0; i < H; i++){
            for(int j = 0; j < W; j++){
                cout << chess(i,j);
            }
            cout << endl;
        }
        cout << endl;
    }
}


Measured memory_bytes: 3080
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int a,b,c,d,x,y,a1,a2,a4,a3;
    cin>>a>>b>>c>>d;
    a1=a*c;
    a2=a*d;
    a3=b*c;
    a4=b*d;
    cout<<max(max(max(a1,a2),a3),a4);
    return 0;
}


Measured memory_bytes: 3636
#include<iostream>

const long long mod = 1e9 + 7;
long long cnt[100005], a[100005], ans = 1;

int main(void) {
	int n;
	std::cin >> n;	
	for (int i = 0; i < n; ++i) std::cin >> a[i];

	for (int i = 0; i < n; ++i) {
		ans = (ans * ((a[i] ? cnt[a[i]-1] : 3) - cnt[a[i]])) % mod;
		cnt[a[i]]++;
	}

	std::cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 5156
#include<bits/stdc++.h>
#include<vector>
#include<string>
using namespace std;
#define l long long
#define pb push_back
#define mem(a,n) memset(a,n,sizeof(a))
#define find(v,n) find(v.begin(),v.end(),n)-v.begin()
#define sort1(v) sort(v.begin(),v.end())
#define lb(v,n) lower_bound(v.begin(),v.end(),n)-v.begin()
#define ub(v,n) upper_bound(v.begin(),v.end(),n)//-v.begin()
#define mod 1000000007
#define reverse(s) reverse(s.begin(),s.end())
//#define pi pair<l,l> 
const double pi=3.141592653589793;
bool isprime(l n)
{
	for(l i=2;i<=n;i++)
	{
		if(n%i==0)
			return false;
	}
	return true;
}
/*bool fact(l n)
{
	vector<l> v;
	for(l i=2;i*i<=n;i++)
	{
		if(n%i==0)
		{
			if(i%2==1||(n/i)%2==1)
			{
				return true;
			}
		}
	}
	return false;
}*/
l power(l a,l b)
{
	l ans=1;
	while(b>0)
	{
		if(b&1)
		{
			ans=(ans*a);
		}
		b>>=1;
		a=(a*a);
	}
	return ans;
}//prefixsums
void frooty()
{
	string a,b;
	cin>>a>>b;
	l c=0;
	for(l i=0;i<(l)a.size();i++)
	{
		if(a[i]!=b[i])
			c++;
	}
	cout<<c<<"\n";
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int q=1;
//	cin>>q;
	while(q--)
	{
		frooty();
	}
}

Measured memory_bytes: 3892
#include <stdio.h>


int main()
{
  int i,n,q,count=0,t,left,right,s,mid,flip;
  scanf("%d",&n);
  int S[n];
  for(i=0;i<n;i++)
    {
      scanf("%d",&S[i]);
    }
  scanf("%d",&q);
  int T[q];
  for(i=0;i<q;i++)
    {
      scanf("%d",&T[i]);
    }  
   for(s=0;s<q;s++)
    {
      for(t=s+1;t<q;t++)
	{
	  if(T[s]==T[t])
	    {
	      break;
	    }	 
	}
      left=0;
      right=n;
      while(left<right)
	    {
	      //printf("left%d,right%d,mid%d\n",left,right,mid);
	      mid=(left+right)/2;
	     
	      if(S[mid]==T[s])
		{
		  count++;
		  break;
		}
	      else if (T[s]<S[mid])
		right =mid;
	      else
		left=mid+1;
	    }
    } 
   printf("%d\n",count);
   return 0;
}



Measured memory_bytes: 2368
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl
#define show2(a, n, m) rep(i, n) { rep(j, m) {cout << a[i][j] << ' ';} cout << endl;} 
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<long long, long long> pll;
typedef long double ld;

const int INF = 1 << 30;
const long long INFL = 1LL << 60;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100010;

int main() {
//	cout << fixed << setprecision(15);
	int x, y, z;
	cin >> x >> y >> z;
	swap(x, y);
	swap(x, z);
	cout << x << ' ' << y << ' ' << z << endl;
}


Measured memory_bytes: 384
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		String w = scan.next();
		int Nb = Integer.valueOf(w);

		String result = "";
		String a = "";

		int n = S.length() / Nb;
		a = S.substring(0, 1);
		result = a;
		for (int i = 1; i < n + 1; i++) {

			if (Nb * i == S.length()) {
				a = S.substring(Nb * i);
			} else {
				a = S.substring(Nb * i, Nb * i + 1);
			}

			result = result + a;
		}

		System.out.println(result);

	}
}


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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}
#define MOD 1000000007
int main() {
	int n = ri();
	int k = ri();
	int res = 0;
	for (int i = k; i <= n + 1; i++) {
		int64_t upper = (int64_t) (n + n - i + 1) * i / 2;
		int64_t lower = (int64_t) (i - 1) * i / 2;
		if (upper >= lower) res = (res + (upper - lower + 1)) % MOD;
	}
	printf("%d\n", res);
	return 0;
}


Measured memory_bytes: 3820
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#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 pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    string s;
    cin >> s;
    REP(i,4) cout << s[i];
    cout << " ";
    FOR(i,4,11) cout << s[i];
    cout << endl;
    return 0;
}


Measured memory_bytes: 764
// C++ (GCC 9.2.1)
// 解き直し.
// https://img.atcoder.jp/abc172/editorial.pdf
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define repex(i, a, b, c) for(int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define repr(i, a, b) for(int i = a; i >= b; i--)
LL A[333];

int main(){
    
    // 1. 入力情報.
    int N;
    scanf("%d", &N);
    rep(i, N) scanf("%lld", &A[i]);
    
    // 2. 解説通り.
    // 2-1. S, X を 設定.
    LL S = A[0] + A[1], X = 0LL;
    repx(i, 2, N) X ^= A[i];
    
    // 2-2. D を 設定.
    LL D = (S - X) / 2LL;
    // printf("S=%lld X=%lld D=%lld\n", S, X, D);
    
    // 2-3. D が 非負整数で無い, または, D と X の 共通ビットがある,
    // または, D が A[0] よりも大きい場合.
    if(D < 0LL || (D & X) != 0LL || D > A[0]){
        puts("-1");
        return 0;
    }
    
    // 2-4. Y を 設定.
    LL Y = 0LL, a = D;
    repr(i, 40, 0){
        LL bit = 1LL << i;
        // printf("bit=%lld (X & bit)=%lld X=%lld Y=%lld (X + Y)=%lld\n", bit, (X & bit), X, Y, X + Y);
        if(X & bit){
            LL c = D ^ (Y | bit);
            // printf("c=%lld\n", c);
            if(c <= A[0]) Y |= bit, X -= bit, a = D ^ Y;
        }
    }
    
    // 2-5. S = a + b が成立しているかのチェック.
    // -> n2_03 などへの対策.
    // ex.
    // 2
    // 5 6
    // -> S = 11, a + b = 10 の ように 差分が出る場合がある.
    LL b = D ^ X;
    // printf("a=%lld b=%lld (a + b)=%lld\n", a, b, a + b);
    if(S != a + b){
        puts("-1");
        return 0;
    }
    
    // 2-6. a < A[0] であるかのチェック.
    // -> sample_03 などへの対策.
    if(a == 0){
        puts("-1");
        return 0;
    }
    
    // 3. 出力.
    printf("%lld\n", A[0] - a);
    return 0;
    
}

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

using namespace std;

#define int long long

signed main() {
    const string k = "keyence";
    string s;
    cin >> s;
    if (s == k) {
        cout << "YES" << endl;
        return 0;
    }
    int l = s.length();
    for (int i = 0; i < l; i++) {
        for (int j = i; j < l; j++)  {
            string S = "";
            for (int si = 0; si < l; si++) {
                if (i <= si && si <= j) {
                    continue;
                }
                else S.push_back(s[si]);
            }
            if (S == k) {
                cout << "YES" << endl;
                return 0;
            }
        }
    }
    cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
while True:
    n = str(N)
    i = 0
    ans = 1
    while True:
        if i >= len(n):
            break
        if n[i] != n[i - 1]:
            ans = -1
            break
        i += 1
    if ans == 1:
        print(n)
        break
    N += 1


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

#define int ll

#define _GLIBCXX_DEBUG

#define REP(i,n) for (int i = 0; i < (n); ++i)
#define REPD(i,n) for (int i = (n-1); i >= 0; --i)
#define FORE(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define debug(x) cerr << #x << ": " << x << '\n'
#define hyphen() cerr << "--\n"

#define ALL(vec) (vec).begin(), (vec).end()
#define REVALL(vec) (vec).rbegin(), (vec).rend()

#define fst first
#define snd second
#define pb push_back

const int MOD = (int)1e9 + 7;
const int INF = numeric_limits<int>::max();

double log5(double x) {
    return log(x) / log(5);
}

signed main() {
    int N;

    cin >> N;

    if (N < 2 || N % 2 == 1) {
        cout << 0 << endl;
        return 0;
    }

    // 圧倒的2の因数により、それは気にしなくていい
    // 5の因数の数を数えればよい。

    int digits = log5(N);
    int ans = 0;
    FORE(i, 1, digits) {
        // 5^i * 2, 5^i * 4, 5^i *6 ... maxは?
        int a = pow(5, i);
        int b = pow(5, i+1);

        // 5の奇数倍は除きたい…

        int num = (N / a) / 2 - (N / b) / 2;
        debug(i);
        debug(num);
        ans += num * i;
    }

    cout << ans << endl;
}


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

int main(){
  int a, b;
  cin >> a >> b;
  int c = -1;
  for (int n=0; n<10000; n++){
    if(n*8/100 == a && n*10/100 == b){
      c = n;
      break;
    }
  }
  cout << c << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;
int main(){
  typedef long long int ll;
string A, B, C;
cin >> A >> B >> C;
int ans = 0;
if(A[A.size() - 1] == B[0])ans++;
if(B[B.size() - 1] == C[0])ans++;
if(ans == 2)cout << "YES" << endl;
else cout << "NO" << endl;
        return 0;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	lines := getLines(2)
	fmt.Println(checker(lines))
}

func checker(lines []string) string {

	s := lines[0]
	t := lines[1]

	sLen := len(lines[0])

	if s != t[:sLen] {
		return "No"
	}

	return "Yes"
}

func getLines(n int) []string {
	var lines []string
	sc := bufio.NewScanner(os.Stdin)
	for i := 0; i < n; i++ {
		sc.Scan()
		t := sc.Text()
		lines = append(lines, t)
	}
	return lines
}


Measured memory_bytes: 1760
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    A, V = readnums()
    B, W = readnums()
    T = readint()
    if A <= B:
        if A + T * V >= B + T * W:
            print('YES')
        else:
            print('NO')
    else:
        if A - T * V <= B - T * W:
            print('YES')
        else:
            print('NO')


if __name__ == "__main__":
    main()


Measured memory_bytes: 9220
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define ll long long
#define db long double
#define ii pair<int,int>
#define vi vector<int>
#define fi first
#define se second
#define sz(a) (int)(a).size()
#define all(a) (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
#define FN(i, n) for (int i = 0; i < (int)(n); ++i)
#define FEN(i,n) for (int i = 1;i <= (int)(n); ++i)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repv(i,a,b) for(int i=b-1;i>=a;i--)
#define SET(A, val) memset(A, val, sizeof(A))
typedef tree<int ,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set ;
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the kth largest element.(0-based)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
const int N=2005;
string s[N];
int mat[N][N],pre[N][N];
int main()
{
  std::ios::sync_with_stdio(false);
  cin.tie(NULL) ; cout.tie(NULL) ;
  int n,m;
  cin>>n>>m;
  rep(i,1,n+1) cin>>s[i],s[i]="#"+s[i];
  rep(i,1,n)
    {
      rep(j,1,m)
	{
	  int cnt=(s[i][j]=='#');
	  cnt+=(s[i+1][j]=='#');
	  cnt+=(s[i][j+1]=='#');
	  cnt+=(s[i+1][j+1]=='#');
	  if(cnt&1) mat[i][j]=0;
	  else mat[i][j]=1;
	}
    }
  int ans=max(n,m);
  rep(i,1,n)
    {
      rep(j,1,m)
	{
	  if(mat[i][j]==1) pre[i][j]=pre[i-1][j]+1;
	  else pre[i][j]=0;
	}
      stack<int> st;
      rep(j,1,m)
	{
	  while(!st.empty() && pre[i][st.top()]>pre[i][j])
	    {
	      int tmp=st.top(); st.pop();
	      int curr=(pre[i][tmp]+1)*(st.empty()?j:j-st.top());
	      ans=max(ans,curr);
	    }
	  st.push(j);
	}
      while(!st.empty())
	{
	  int tmp=st.top(); st.pop();
	  int curr=(pre[i][tmp]+1)*(st.empty()?m:m-st.top());
	  ans=max(ans,curr);
	}
    }
  cout<<ans<<endl;
  return 0 ;
}


Measured memory_bytes: 35840
X, Y = map(int, input().split())

def money(n):
  ret = 0
  if n == 1:
    ret = 300000
  elif n == 2:
    ret = 200000
  elif n == 3:
    ret = 100000
  
  return ret 

ans = 0
ans += money(X) + money(Y)
if X == 1 and Y == 1:
  ans += 400000
print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#define rep(i, n) for (int i=0;i<n;i++);
using namespace std;
typedef long long ll;

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

    ll N;
    cin >> N;
    ll result = N - 1;
    for(ll i=1;i<=sqrt(N);i++){
        if(N%i == 0){
            result = min(result, i + (N/i) - 2);
        }
    }
    cout << result << endl;
}

Measured memory_bytes: 256
#include <math.h>

#include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using P = pair<int, int>;

int main() {
  int a, b;
  cin >> a >> b;
  int ans = 0;
  int add = 1;
  if (b == 1) {
    cout << 0;
  } else {
    while (1) {
      if (add >= b) {
        break;
      }
      add += a - 1;
      ans++;
    }
    cout << ans;
  }
  return 0;
}


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

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;

#define rep(a,n) for(int a = 0;a < n;a++)
#define repi(a,b,n) for(int a = b;a < n;a++)

const ull mod = (ull)1e9 + 7;

int main(void)
{
	ll n, k, s;
	cin >> n >> k >> s;
	const ll u = 1e9;
	if (s == u) {
		rep(i, k) {
			cout << u << " ";
		}
		rep(i, n - k) {
			cout << 1 << " ";
		}
		cout << endl;
		return 0;
	}
	else {
		rep(i, k) {
			cout << s << " ";
		}
		rep(i, n - k) {
			cout << (s+1) << " ";
		}
		cout << endl;
		return 0;
	}
	return 0;
}


Measured memory_bytes: 1280
import java.util.Scanner;

public class Main {
  
    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int a = scan.nextInt();
      int b = scan.nextInt();
      int c = scan.nextInt();

      int d;

      d = a;
      a = b;
      b = d;

      d = a;
      a = c;
      c = d;

      System.out.println(a+" "+b+" "+c);
      
      }

  }


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

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

    int n, q; cin >> n >> q;
    string s; cin >> s;

    int cnts[n]; cnts[0] = 0;
    for (int i = 0; i < n - 1; ++i) {
        cnts[i + 1] = cnts[i];
        if (s[i] == 'A' && s[i + 1] == 'C') {
            ++cnts[i + 1];
        }
    }

    for (int i = 0; i < q; ++i) {
        int l, r; cin >> l >> r; --l; --r;
        int ans = cnts[r];
        if (l > 0) ans -= cnts[l - 1];
        if (l > 0 && s[l - 1] == 'A' && s[l] == 'C') {
            --ans;
        }
        cout << ans << endl;
    }
    
    return 0;
}

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

int main()
{
    int d;
    cin >> d;
    int a[10];
    ll num = 0;
    for(int i = 0;i < d;i++)
    {
        cin >> a[i];
    }
    sort(a,a + d);
    for(int i = 0;i < d - 1;i++)
    num += a[i];
    num += (a[d - 1] / 2);
    cout << num << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
  int N, flag=0;
  cin >> N;
  int H[N];
  for(int i=0; i<N; i++) cin >> H[i];
  for(int i=0; i<N-1; i++){
    if(H[i] > H[i+1]){
      flag = 1; break;
    }
    if(H[i]+1 <= H[i+1]) H[i+1]--;
  }
  if(flag == 1) cout << "No" << endl;
  else cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 640
n = int(input())
nums = list(map(int, input().split()))
count = 0

for i in range(n):
    minj = i

    for j in range(i + 1, n):
#    for j in range(i, n):
        if nums[j] < nums[minj]:
            minj = j
#            count += 1
    else:
        if nums[i] > nums[minj]:
            temp = nums[minj]
            nums[minj] = nums[i]
            nums[i] = temp
            count += 1

print(' '.join([str(i) for i in nums]))
print(count)



Measured memory_bytes: 5608
using static System.Math;
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //var line = ReadLine().Split(' ').Select(value => long.Parse(value)).ToArray();
            var a = long.Parse(ReadLine());
            

            WriteLine(a + a * a + a * a * a);
        }
    }
}


Measured memory_bytes: 17588
import sys
input = sys.stdin.readline
n,q = (int(i) for i in input().split())
s = input()
td = [[i for i in input().split()] for i in range(q)][::-1]

now = s[0]
pre = ""
idx = 0
for t,d in td:
    if t==now and d=="L":
        idx += 1
        now = s[idx]
        pre = s[idx-1]
    elif t==pre and d=="R" and idx != 0:
        idx -= 1
        now = s[idx]
        pre = s[max(0,idx-1)]
        
res = n-idx
now = s[n-1]
pre = ""
idx = n-1
for t,d in td:
    if t==now and d=="R":
        idx -= 1
        now = s[idx]
        pre = s[idx+1]
    elif t==pre and d=="L" and idx != n-1:
        idx += 1
        now = s[idx]
        pre = s[min(n-1,idx+1)]

print(max(0,res-(n-1-idx)))


Measured memory_bytes: 28380
#include <iostream>
#include <vector>
#include <algorithm>
#include <array>
#include <string>

int main()
{
  std::string S, T, U;
  int A, B;

  std::cin >> S >> T >> A >> B >> U;

  if (U == S) --A;
  else --B;

  std::cout << A << " " << B << std::endl;
}


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

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

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

  if(s.size()<=k) cout << s;
  else{
    rep(i,k) cout << s.at(i);
    cout << "...";
  }
  
}

Measured memory_bytes: 3628
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <list>
#include <set>
#include <stack>
#include <cctype>
#include <cmath>

using namespace std;

/* typedef */
typedef long long ll;

/* constant */
const int INF = 1 << 30;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;

/* global variables */

/* function */

/* main */
int main(){

    int n, m, x;
    set<int> odd, even;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> x;
        odd.insert(x);
    }
    cin >> m;
    for (int i = 0; i < m; i++) {
        cin >> x;
        even.insert(x);
    }


    // 1 ==========================================
    vector<int> v1;
    set_union(odd.begin(), odd.end(),
                        even.begin(), even.end(),
                        inserter(v1, v1.end()));

    for (auto e: v1) {
        cout << e << '\n';
    }

    /*
    // 2 ==========================================
    set<int> s2;  // for 2
    set_union(odd.begin(), odd.end(),
          even.begin(), even.end(),
          inserter(s2, s2.begin()));

    for (auto const &e: s2) {
        cout << e << '\n';
    }

    // 3 ==========================================
    set<int> s3;  // for 3
    merge(odd.begin(), odd.end(),
        even.begin(), even.end(),
        inserter(s3, s3.begin()));

    for (auto const &e: s3) {
        cout << e << '\n';
    }
    */
}



Measured memory_bytes: 23676
S = input()
ans = 'AC'
if S[0] != 'A':
    ans = 'WA'
cnt = 0
for i in S[2:len(S) - 1]:
    if i == 'C':
        cnt += 1
if cnt != 1:
    ans = 'WA'
cnt = 0
for i in S:
    if 'A' <= i and i <= 'Z':
        cnt += 1
if cnt != 2:
    ans = 'WA'
print(ans)


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

using namespace std;

int main() {
	string s, t;
  	cin >> s >> t;
  	int ans = 0;
  	for (int i = 0; i < s.length(); i++)
      	if (s[i] == t[i])
          	ans++;
  	cout << ans;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-10;
const long double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
long double ABS(long double a){return max(a,-a);}
int main(){
	int a,b,c;scanf("%d%d%d",&a,&b,&c);
	long long k;scanf("%lld",&k);
	if(k%2==0){
		printf("%d\n",a-b);
	}else{
		printf("%d\n",b-a);
	}
}

Measured memory_bytes: 128
import java.io.FileNotFoundException;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {
		long startTime = System.currentTimeMillis();
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int ans = 0;
		String S = sc.next();
		for (int i = 0; i < N; ++i) {
			int j = i;
			while (j + 1 < N && S.charAt(i) == S.charAt(j + 1)) {
				++j;
			}
			i = j;
			++ans;
		}
		System.out.println(ans);
	}

	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}

Measured memory_bytes: 24148
#include <bits/stdc++.h>
#define itn int
#define REP(i, n) for (ll i = 0; i < n; i++)
#define IREP(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define all(v) v.begin(), v.end()
#define SENTINEL 2000000000
#define NIL -1
using namespace std;
typedef long long ll;

const ll MAX = 510000;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

int main()
{
    int h, w, m;
    cin >> h >> w >> m;
    set<pair<int, int>> s;
    map<int, int> gyou;
    map<int, int> retsu;
    REP(i, m)
    {
        int a, b;
        cin >> a >> b;
        s.insert(make_pair(a, b));
        gyou[a]++;
        retsu[b]++;
    }
    int maxh = -1;
    vector<pair<int,int>> q1;
    for (auto &i : gyou)
    {
        if (maxh < i.second)
        {
            maxh = i.second;
        }
    }
    for (auto &i : gyou)
    {
        if (maxh == i.second)
        {
            q1.push_back(i);
        }
    }
    vector<pair<int, int>> q2;
    int maxw = -1;
    for (auto &i : retsu)
    {
        if (maxw < i.second)
        {
            maxw = i.second;
        }
    }
    for (auto &i : retsu)
    {
        if (maxw == i.second)
        {
            q2.push_back(i);
        }
    }
    REP(x,q1.size()){
        pair<int,int> i=q1[x];
        REP(y,q2.size()){
            pair<int,int> j=q2[y];
            if (s.find(make_pair(i.first, j.first)) == s.end())
            {
                cout << maxh + maxw << endl;
                return 0;
            }
        }
    }
    cout << maxh + maxw - 1 << endl;
}


Measured memory_bytes: 53840
#!/usr/bin/env python3
# -*- coding: <encoding-name> -*-

import sys

x, y = map(int, sys.stdin.readline().strip().split(" "))
if x % y == 0:
    print(-1)
else:
    for i in range(1, y):
        if x * i % y > 0:
            print(x * i)
            break

Measured memory_bytes: 2940
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		int N = S.Length;
		int K = T.Length;
		String min = new String(Enumerable.Repeat('Z',N+1).ToArray());
		for(int i=0;i<N;i++){
			if(i + K > N) break;
			bool chk = true;
			for(int j=0;j<K;j++){
				if(S[i+j] != T[j] && S[i+j] != '?'){
					chk = false;
					break;
				}
			}
			if(!chk) continue;
			var ca = S.ToCharArray();
			for(int j=0;j<K;j++) ca[i+j] = T[j];
			for(int j=0;j<N;j++) if(ca[j] == '?') ca[j] = 'a';
			
			var ns = new String(ca);
			if(ns.CompareTo(min) < 0) min = ns;
			
		}
		
		Console.WriteLine(min.Length != N ? "UNRESTORABLE" : min);
		
		
		
	}
	String S;
	String T;
	public Sol(){
		S = rs();
		T = rs();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 13408
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define each(i, a) for(auto &i : a)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x))
#define line cout << "------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause") //comment out this on AOJ.
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10; //1e-9?
constexpr ld pi = 3.1415926535897932;
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; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }

int main() {
    init();

    clock_t start = clock();

    int n; cin >> n;
    vector<ld> x(n), y(n);
    vector<char> d(n);
    FOR(i, 0, n)cin >> x[i] >> y[i] >> d[i];

    map<char, ld> Xdir, Ydir;
    Xdir['R'] = 1, Xdir['L'] = -1;
    Ydir['U'] = 1, Ydir['D'] = -1;
    function<ld(ld)> f = [&](ld t) {
        ld Xmax = -LLINF, Xmin = LLINF;
        ld Ymax = -LLINF, Ymin = LLINF;
        FOR(i, 0, n) {
            ld nx = x[i] + t * Xdir[d[i]];
            ld ny = y[i] + t * Ydir[d[i]];
            chmax(Xmax, nx), chmin(Xmin, nx);
            chmax(Ymax, ny), chmin(Ymin, ny);
        }
        return (Xmax - Xmin) * (Ymax - Ymin);
    };

    ld l = 0, r = INF;
    while (clock() < start + 4988000) {
        ld m1 = (l * 2 + r) / 3, m2 = (l + r * 2) / 3;
        if (f(m1) < f(m2))r = m2;
        else l = m1;
    }
    cout << f(l) << "\n";
}

Measured memory_bytes: 3456
#include <stdio.h>
#include <math.h>
 
int main()
{
    double x1, y1, x2, y2;
     
    scanf("%lf%lf%lf%lf", &x1, &y1, &x2, &y2);
    printf("%.8lf\n", hypot(x1-x2, y1-y2));
    return 0;
}


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

using namespace std;

void Main() {
    long long N, A, B;
    cin >> N >> A >> B;

    long long full = N / (A + B);
    long long res = N % (A + B);
    if (res <= A) {
        cout << (full * A + res) << endl;
    }
    else if (A <= res) {
        cout << (full * A + A) << endl;
    }
}

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


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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

int main(){
    ll n;cin>>n;
    vector<ll>a(n,0);
    string s;cin >>s;
    for (int i = 0; i < n; ++i) {
        if(s[i]=='(')a[i]++;
        else a[i]--;
    }
    vector<ll>sum(n+1,0);
    for (int i = 0; i < n; ++i) {
        sum[i+1]=sum[i]+a[i];
    }
    string ans="";
    ll mint=0;
    for (int i = 0; i < n+1; ++i) {
        mint=min(mint,sum[i]);
    }
    mint*=-1;
    for (int i = 0; i <mint; ++i) {
        ans+='(';
    }
    ans+=s;
    ll d=sum[n]+mint;
    if(d>0){
        for (int i = 0; i <d; ++i) {
            ans+=')';
        }
    }
    cout <<ans <<endl;
    return 0;
}

Measured memory_bytes: 3640
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		scan.close();
		int cnt = 0;
		for(int i = 0; i < S.length(); i++) {
			String s = S.substring(i, i + 1);
			if(s.equals("o")) {
				cnt ++;
			}
		}
		int ans = 700 + 100 * cnt;
		System.out.println(ans);
	}
}

Measured memory_bytes: 21844
#include <stdio.h>
#include <string.h>
int main(void){
    int n,mv[10][6],map[10][6],i,o,sign,sum=1,start,ans,t,r;
    for(;ans=0,memset(mv,0,sizeof(mv)),memset(map,0,sizeof(map)),scanf("%d",&n),n;){
        for(i=n-1;i>=0;i--)
            for(o=0;o<5;o++)
                scanf("%d",&map[i][o]);
        for(sign=1;memset(mv,0,sizeof(mv)),sum=1,sign;){
            sign=0;
            for(i=0;i<n;i++){
                for(o=0;o<5;o++){
                    if(map[i][o] != 0 && map[i][o] == map[i][o+1]){
                        if(sum == 1)
                            start=o;
                        sum++;
                    }
                    else if(sum >= 3){
                        ans+=map[i][o]*sum;
                        sign=1;
                        for(t=sum;t;t--)
                            map[i][start+t-1]=0;
                        sum=1;
                    }
                    else
                        sum=1;
                }

            }
            for(i=1;i<n;i++){
                for(o=0;o<5;o++){
                    if(map[i-1][o] == 0)
                        mv[i][o]=mv[i-1][o]+1;
                    else
                        mv[i][o]=mv[i-1][o];
                }
            } 
            for(i=1;i<n;i++){
                for(o=0;o<5;o++){
                    if(map[i][o] !=  0 && mv[i][o] != 0 ){
                        map[i-mv[i][o]][o]=map[i][o];
                        map[i][o]=0;
                    }
                }
            }
        }
        printf("%d\n",ans);
    }
    return 0;
}

Measured memory_bytes: 600
import sys
input=lambda: sys.stdin.readline().rstrip()

N = int(input())

S_p = []
S_n = []

for i in range(N):
  end = 0
  mim = 0
  for c in input():
    if c == "(":
      end += 1
    else :
      end -= 1
    mim = min(mim,end)
  
  if end >= 0:
    S_p.append([mim, end])
  else:
    S_n.append([end-mim, end])
  
S_p.sort(reverse=True)
S_n.sort(reverse=True)
#print(S_p)
#print(S_n)

check = 0
flag = True
for i in range(len(S_p)):
  if check + S_p[i][0] >= 0:
    check += S_p[i][1]
  else:
    flag = False
    break
  #print(check)
  
for i in range(len(S_n)):
  if check + S_n[i][1] - S_n[i][0] >= 0:
    check += S_n[i][1]
  else:
    flag = False
    break
  #print(check)
  
if check == 0 and flag:
  flag = True
else:
  flag = False

print("Yes" if flag else "No")

Measured memory_bytes: 96112
#include <bits/stdc++.h>
using namespace std;
const   int MaxN=1e5+5;
int p[MaxN],s,t,q[MaxN],m;

void Data()
{
    for(int i=1;i<=6;i++)
    {
        q[i]=i;
        if (p[i]==s) s=i;
        if (p[i]==t) t=i;
    }
}

int ans=1,temp;

void F_S()
{
    temp=q[1];
    q[1]=q[5];q[5]=q[6];q[6]=q[2];q[2]=temp;
}

void F_E()
{
    temp=q[1];
    q[1]=q[4];q[4]=q[6];q[6]=q[3];q[3]=temp;
}

void F_W()
{
    temp=q[1];
    q[1]=q[3];q[3]=q[6];q[6]=q[4];q[4]=temp;
}

void F_N()
{
    temp=q[1];
    q[1]=q[2];q[2]=q[6];q[6]=q[5];q[5]=temp;
}

void F_R()
{
    temp=q[2];
    q[2]=q[4];q[4]=q[5];q[5]=q[3];q[3]=temp;
}

void solve()
{
    Data();
    if (s==4)F_E();
    else
        if (s==3) F_W();
        else
        {
            while (s!=q[1]) F_N();
        }
    while (t!=q[2]) F_R();
}
int main()
{
    for(int i=1;i<=6;i++)
        scanf("%d",&p[i]);
    scanf("%d",&m);
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&s,&t);
        solve();
        printf("%d\n",p[q[3]]);
    }
}



Measured memory_bytes: 3200
#include<iostream>
#include<vector>
#include<string>
#include<math.h> 
#include<algorithm> 
#include<stdio.h> 
#include<sstream>
#include<fstream>  
using namespace std; 
typedef long long ll; 
typedef long double ld; 

int ceil(int a, int m){
    // division of a and m
    if(a % m == 0){
        return a/m; 
    }
    else{
        return a/m + 1; 
    }
}

vector<int> sort(vector<int> arr){
    sort(arr.begin(), arr.end()); 
    return arr; 
}

int minInVector(vector<int> arr){
    int mins = 1e9; 
    for(int i = 0; i<arr.size(); i++){
        mins = min(mins, arr[i]); 
    }
    return mins; 
}

int maxInVector(vector<int> arr){
    int maxs = -1; 
    for(int i = 0; i<arr.size(); i++){
        maxs = max(maxs, arr[i]); 
    }
    return maxs; 
}

bool checkElement(vector<int> arr, int k){
    for(int i = 0; i<arr.size(); i++){
        if(arr[i] == k){
            return true; 
        }
    }
    return false; 
}

char nl = '\n'; 
char bl = ' ';
void solve(){
    int n; 
    cin >> n; 
    vector<ll> ins; 
    for(int i = 0; i<n; i++){
        ll a; 
        cin >> a; 
        ins.push_back(a); 
    }
    ll ans = 0; 
    for(int i = 1; i<ins.size(); i++){
        if(ins[i] < ins[i-1]){
            ans+=(ins[i-1] - ins[i]); 
           // cout << ins[i-1] - ins[i] << nl; 
                ins[i] = ins[i-1]; 

        }
    }
    cout << ans; 
}


const int MOD = 1e9 + 7; 



int main(){

ios_base::sync_with_stdio(false);
cin.tie(NULL); 

/*
For array arr use the following preamble to sort
int diff = sizeof(arr)/sizeof(arr[0]); 
sort(arr, arr + diff); 

*/
 
solve(); 


}



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

int main()
{
    long long n,a,b,c;
    cin>>n>>a>>b;
    c=(n/(a+b))*a;
    n%=(a+b);
    if(n>a) c+=a;
    else c+=n;
    cout<<c;
}


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

#include <bits/stdc++.h>

using namespace std;

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

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

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

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

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

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

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

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

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

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

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

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

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

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


signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    cout << (n - 2) * 180;
}

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


Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
const int N = 20;

// next_combination version
// given an integer cur, next_combination returns an integer nxt s.t.
//   nxt has the same number of 1s as cur
//   nxt is bigger than cur
//   no integer between cur and nxt has the same number of 1s as cur (and nxt)
int next_combination(int cur)
{
  int r1 = cur & -cur;   // extracts the rightmost 1
  int moved1 = cur + r1; // cancel the rightmost run of 1s and put 1 on its left
  int rm1s = cur & ~moved1; // extracts the rightmost run of 1s
  int reset = (rm1s / r1) >> 1; // the run of 1s moved to LSD and made its length decreased by 1
  int nxt = moved1 | reset; // new combination
  return nxt;
}
int main(int argc, char *argv[])
{
  for(;;) {
    int n, k, s;
    cin >> n >> k >> s;
    if(n == 0 && k == 0 && s == 0) break;
    int cnt = 0;
    if(k <= n) {
      const int fin = ((1<<k) - 1) << (n-k);
      for(int i = (1<<k) - 1; ; i = next_combination(i)) {
        int ss = 0;
        for(int j = 1, x = 1; j <= i; j<<=1, x++) {
          if(i & j) { ss+=x; }
        }
        if(s == ss) cnt++;
        if(i == fin) break;
      }
    }
    cout << cnt << endl;
  }
  return 0;
}



Measured memory_bytes: 3080
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define mod 1000000007
#define inf 1e18+42
#define endl "\n"
#define pi 3.1415926535897932384626433832795028841971693993751058
#define maxn 100005

#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl

#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define fori(it,A) for(auto it=A.begin();it!=A.end();it++)

#define ft first
#define sd second
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define all(x) (x).begin(),(x).end()
#define zero(x) memset(x,0,sizeof(x));
#define ceil(a,b) (a+b-1)/b
 
using namespace std;

int binpow(int a, int b) {
    int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

//START OF CODE ->->->->->->->

void solve()
{
    int n,k;
    cin>>n>>k;
    vector<int> a(n);
    rep(i,0,a.size()){
        cin>>a[i];
    }
    rep(i,0,n-k){
        if ( a[i] < a[i+k] ){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }
}

//END OF CODE ->->->->->->->->

signed main()
{
    fast;
    int t = 1;
    // cin>>t;

    while(t--)
    {
        solve();
    }
    return 0;
}



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

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String line = reader.readLine();
		String[] str = line.split("");
		int[] s = new int[str.length];
		for (int i = 0; i < s.length; i++) {
			s[i] = Integer.parseInt(str[i]);
		}
		int a = s[0] * 10 + s[1];
		int b = s[2] * 10 + s[3];
		if (1 <= a && a <= 12) {
			if (1 <= b && b <= 12) {
				System.out.println("AMBIGUOUS");
			}
			else if (0 <= b && b <= 99) {
				System.out.println("MMYY");
			}
		}
		else if (0 <= a && a <= 99) {
			if (1 <= b && b <= 12) {
				System.out.println("YYMM");
			}
			else {
				System.out.println("NA");
			}
		}
		
//		String[] str = reader.readLine().split(" ");
//		int[] ab = new int[str.length];
//		for (int i = 0; i < str.length; i++) {
//			ab[i] = Integer.parseInt(str[i]);
//		}
	}
}

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

int main(){
  
  string a;
  cin >> a;
  
  if( a.at(0) == '7' || a.at(1) == '7' || a.at(2) == '7' ){
    
    cout << "Yes" << endl;
    
  }
  
  else{
    
    cout << "No" << endl;
    
  }
  
}


Measured memory_bytes: 3616