akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Linq;
using System.Diagnostics;
using System.Globalization;
using static System.Console;
using static System.Math;


namespace abc101_c
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input = ReadLine().Split().Select(int.Parse).ToArray();
            int n = input[0];
            int k = input[1];
            int[] arr = ReadLine().Split().Select(int.Parse).ToArray();
            int min = int.MaxValue;
            int p=0;
            double cnt=0;

            cnt = (double)(n-1)/(k-1);

            WriteLine(Ceiling(cnt));
        }

        /// 値のスワップ
        static void Swap<T>(ref T lhs, ref T rhs)
        {
            T temp;
            temp = lhs;
            lhs = rhs;
            rhs = temp;
        }


    }
}

Measured memory_bytes: 19936
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define _for(i,j,k) for(int i=j;i<k;i++)
const int MAX=200005;
const int mod=1e9+7;
ll a[MAX],cnt[MAX];
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    	int n,x;cin>>n;
	_for(i,0,n){
		cin>>a[i];
		++cnt[a[i]];
	}
	ll ans = 0;
	_for(i,1,n + 1)ans+= (1ll*cnt[i]*(1ll*cnt[i]-1))/2;
	_for(i,0,n){
		cout<<ans-cnt[a[i]]+1<<'\n';
	}
}


Measured memory_bytes: 4736
//g++ -std=c++14 test.cpp -o test.out
 
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <map> 
#include <unordered_map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (1LL<<60);
const int INF_INT = 2147483647-1e6-1;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

LL R,C,K;
vector<vector<LL>> item;
 
LL ans = 0;

void solve(){
	//dp[r][c][r_item]
	//位置(r,c)にいて、r行目ですでにr_item個とっている時の価値の最大値
	vector<vector<vector<LL>>> dp(R+1,vector<vector<LL>>(C+1,vector<LL>(4,0)));
	auto show_dp = [&](){
		for(int r=0;r<=R;r++){
			for(int c=0;c<=C;c++){
				printf("(%lld,%lld,%lld,%lld)",dp[r][c][0],dp[r][c][1],dp[r][c][2],dp[r][c][3]);
			}
			cout << endl;
		}
		cout << endl;
	};
	//回収するイメージ
	for(int r=1;r<=R;r++){
		for(int c=1;c<=C;c++){
			//上から遷移してきた時
			for(int now_item=0;now_item<=3;now_item++){
				for(int prev_item=0;prev_item<=3;prev_item++){
					//printf("(%d,%d) nowitem=%d,previtem=%d:",r,c,now_item,prev_item);
					//cout << dp[r][c][now_item] << "->";
					dp[r][c][now_item] = max(dp[r][c][now_item],dp[r-1][c][prev_item]);
					// cout << dp[r][c][now_item] << endl;
					// cout << dp[r][c-1][prev_item] << endl;
				}
			}
			//show_dp();
			//左から遷移してきた時
			for(int now_item=0;now_item<=3;now_item++){
				dp[r][c][now_item] = max(dp[r][c][now_item],dp[r][c-1][now_item]);
			}
			//そのマスのアイテムを取る時
			for(int now_item=3;now_item>=1;now_item--){
				dp[r][c][now_item] = max(dp[r][c][now_item],dp[r][c][now_item-1]+item[r][c]);
			}
		}
	}
	//show_dp();
	ans = dp[R][C][3];
}
 
int main(){
    cin >> R >> C >> K;
    item = vector<vector<LL>>(R+1,vector<LL>(C+1,0));
    for(int i=0;i<K;i++){
    	LL r,c,v;
    	cin >> r >> c >> v;
    	item[r][c] = v;
    }
 
    solve();
 
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 706728
// 1: x < xi
// 2: x > xi
// 3: y < yi
// 4: y > yi

#include <stdio.h>
#define BL 0
#define WH 1
int main () {
  int W, H, N, x[100], y[100], a[100];
  int wall[100][100], whiteArea = 0;
  int index, i, j;

  // read
  scanf ("%d %d %d", &W, &H, &N);
  for (index = 0; index < N; index++) {
    scanf ("%d %d %d", &x[index], &y[index], &a[index]);
  }

  // wall init
  for (i = 0; i < H; i++) {
    for (j = 0; j < W; j++) {
      wall[i][j] = WH;
    }
  }

  // draw black
  for (index = 0; index < N; index++) {
    switch (a[index]) {
      case 1:
      for (i = 0; i < H; i++) {
        for (j = 0; j < x[index]; j++){
          wall[i][j] = BL;
        }
      }
      break;

      case 2:
      for (i = 0; i < H; i++) {
        for (j = x[index]; j < W; j++){
          wall[i][j] = BL;
        }
      }
      break;

      case 3:
      for (i = 0; i < y[index]; i++) {
        for (j = 0; j < W; j++){
          wall[i][j] = BL;
        }
      }
      break;

      case 4:
      for (i = y[index]; i < H; i++) {
        for (j = 0; j < W; j++){
          wall[i][j] = BL;
        }
      }
    }
  }

  //count WH
  for (i = 0; i < H; i++){
    for (j = 0; j < W; j++){
      whiteArea += wall[i][j];
    }
  }

  /*
  // draw wall
  for (i = 0; i < H; i++) {
    for (j = 0; j < W; j++){
      if (wall[i][j] == BL) printf ("*");
      else printf (" ");
    }
    printf ("\n");
  }
  */

  // output
  printf ("%d", whiteArea);

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
int n,k,a,i;
  a=1;
  scanf("%d %d",&n,&k);
  for(i=0;i<n;++i)
  {
  if(a<k) a=a*2;
  else a=a+k;
  }
 printf("%d",a);
return 0;}

Measured memory_bytes: 1732
dhw = [(1,0),(0,-1),(0,1),(-1,0),
( 2,-2),( 2,-1),( 2, 0),( 2, 1),( 2, 2),
( 1,-2),( 1,-1),        ( 1, 1),( 1, 2),
( 0,-2),                        ( 0, 2),
(-1,-2),(-1,-1),        (-1, 1),(-1, 2),
(-2,-2),(-2,-1),(-2, 0),(-2, 1),(-2, 2)]

H, W = map(int, input().split())
sh, sw = map(lambda x:int(x)-1, input().split())
eh, ew = map(lambda x:int(x)-1, input().split())
S = [input() for _ in range(H)]

dst = [[-1]*W for _ in range(H)]

from collections import deque
dq = deque([(sh, sw, 0)])
while dq:
    h, w, d = dq.popleft()
    if 0 <= h < H and 0 <= w < W and dst[h][w] < 0 and S[h][w] != '#':
        dst[h][w] = d
    else:
        continue
    for i in range(4): dq.appendleft((h + dhw[i][0], w + dhw[i][1], d))
    for i in range(4, 24): dq.append((h + dhw[i][0], w + dhw[i][1], d+1))

print(dst[eh][ew])


Measured memory_bytes: 263560
#include <cstdio>
typedef long long ll;

int n,k;
int Fac[500005],Inv[500005];
const int p=998244353;

ll Pow(ll a,ll b)
{
    ll s=1;
    for(;b;b>>=1,a=a*a%p)
        if(b&1)s=s*a%p;
    return s%p;
}

inline int C(const int n,const int m){return (ll)Fac[n]*Inv[m]%p*Inv[n-m]%p;}

int main()
{
    scanf("%d%d",&n,&k);
    for(int i=Fac[0]=1;i<=k;++i)Fac[i]=(ll)Fac[i-1]*i%p;
    Inv[k]=Pow(Fac[k],p-2);
    for(int i=k;i>=1;--i)Inv[i-1]=(ll)Inv[i]*i%p;
    int Ans=0;
    for(int i=n;i<=k;++i)Ans=(Ans+C(k-1,i-1))%p;
    printf("%d\n",Ans);
    return 0;
}

Measured memory_bytes: 4096
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <cmath>

auto& in = std::cin;
auto& out = std::cout;
#define all_range(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;

int32_t N,K;

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N >> K;
	int count = 0;
	for (size_t i = 1; i <= N; i+=2)
	{
		++count;
	}
	if (count >= K) {
		out << "YES" << endl;
	}
	else {
		out << "NO" << endl;
	}
	return 0;
}
#endif


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
using namespace std;
#define DEBUG(x) cout<<#x<<"="<<x<<endl
#define DEBUG2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<endl
typedef long long ll;
// #define LOCAL
const int MAXN=1e6+10;
const ll MOD=17;
ll _gcd(ll a,ll b){if(b==0)return a;return _gcd(b,a%b);}
ll gcd(ll a,ll b){a=abs(a),b=abs(b);if(a<b)swap(a,b);return _gcd(a,b);}
ll qpow(ll a,ll n){ll rt=1;while(n){if(n&1)rt=(rt*a)%MOD;a=a*a%MOD;n>>=1;}return rt;}
ll factor[MAXN];
void cal_factor(){factor[0]=1;for(int u=1;u<MAXN;u++){factor[u]=(factor[u-1]*u)%MOD;}}
ll C(ll n,ll k){return factor[n]*qpow(factor[n-k],MOD-2)%MOD*qpow(factor[k],MOD-2)%MOD;}
bool notprime[MAXN];
void solve(){
    int n;
    cin>>n;
    unordered_map<int,int>cnt;
    vector<int>A;
    for(int u=0;u<n;u++){
        int a;
        cin>>a;
        A.push_back(a);
        for(int p=2;p*p<=a;p++){
            bool has=false;
            while(a%p==0){
                a/=p;
                has=true;
            }
            if(has)cnt[p]++;
        }
        if(a>1)cnt[a]++;
    }
    int pmax=0;
    // assert(cnt.empty()==false);
    for(auto p:cnt){
        pmax=max(pmax,p.second);
    }
    if(pmax==1||pmax==0)cout<<"pairwise coprime\n";
    else {
        int g=gcd(A[0],A[1]);
        for(int u=2;u<n;u++){
            g=gcd(g,A[u]);
        }
        if(g==1)cout<<"setwise coprime\n";
        else cout<<"not coprime\n";
    }
}
int main()
{
#ifdef LOCAL
    freopen("in.txt","r",stdin);
#endif
    solve();
}

Measured memory_bytes: 10376
n=int(input())
task=[]
for i in range(n):
  a,b=map(int, input().split())
  task.append([b,a])
task.sort()

time=0
for b,a in task:
  if time+a <= b:
    time+=a
  else:
    print("No")
    break
else:
  print("Yes")

Measured memory_bytes: 35600
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define ULL unsigned long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<LL,LL>
#define x first
#define y second
#define pi acosl(-1)
#define sqr(x) ((x)*(x))
#define pdd pair<double,double>
#define MEMS(x) memset(x,-1,sizeof(x))
#define MEM(x) memset(x,0,sizeof(x))
#define EPS 1e-4
#define arg ARG
#define cpdd const pdd
#define rank Rank
#define MAXN 205
//#define N 262144
#define ULL unsigned long long
#define ll long long
int dp[5005][5005][3];
int mod=1e9+7;
LL f_pow(LL a,LL b){
    LL res=1,temp=a;
    while(b){
        if(b&1)res=res*temp%mod;
        temp=temp*temp%mod;
        b>>=1;
    }
    return res;
}
int main(){
    int n,a,b;
    scanf("%d %d %d",&n,&a,&b);
    if(a>b)swap(a,b);
    if(a==1){
        printf("%lld\n",f_pow(2,n));
        return 0;
    }
    dp[1][1][1]=1;
    dp[1][1][0]=1;
    dp[0][0][1]=1;
   // dp2[0][0]=1;
   // dp2[1][1]=2;
    LL ans=0;
    for(int i = 2;i<=n;i++){
        for(int j=2;j<=i;j++){
           // if(j<=b){
                dp[i][j][1]+=(dp[i-1][j-1][1]+dp[i-1][j-1][2])%mod;
                dp[i][j][1]%=mod;
                dp[i][j][2]+=dp[i-1][j-1][2];
                dp[i][j][2]%=mod;
                if(j>=a){
                    dp[i][j][2]+=dp[i-a][j-a][1];
                    dp[i][j][2]%=mod;
                }
           // }
            if(j<a){
                dp[i][j][0]+=dp[i-1][j-1][0];
                dp[i][j][0]%=mod;
            }
        }
        for(int j=1;j<a;j++){
            dp[i][1][1]+=dp[i-1][j][0];
            dp[i][1][1]%=mod;
        }
        for(int j=1;j<b;j++){
            dp[i][1][0]+=dp[i-1][j][1];
            dp[i][1][0]%=mod;
        }
      /*  for(int j = 1;j<=i;j++){
            printf("%d %d %d %d %d\n",i,j,dp[i][j][0],dp[i][j][1],dp[i][j][2]);
        }*/
        ans+=(dp[i][b][1]+dp[i][b][2])*1ll*f_pow(2,n-i)%mod;
        if(i>=b)
        for(int j = b-a+1;j<b;j++){
            ans+=(dp[i-a][j][1])*1ll*f_pow(2,n-i)%mod;
        }
        ans%=mod;
    }
    printf("%d\n",ans);
}
/*
1000000000000000000
1000000000000000000 1 1 1 1000000000
*/


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

isApproved = True
for i in a:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
			isApproved = False
			break

result = "APPROVED" if isApproved else "DENIED"

print(result)


Measured memory_bytes: 2940
#include<stdio.h>
int main(void){
  int x,y;
scanf("%d %d",&x,&y);
if(y%2==1){
  printf("No\n");}
else if(2*x<=y&&y<=4*x){
  printf("Yes\n");}
  else{
  printf("No\n");}
  return 0;
  
}



Measured memory_bytes: 1620
#include <bits/stdc++.h>
#define sz(x) (int)(x).size()
#define For(i, a, b) for (int i = int(a); i < int(b); i++)
#define Dor(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define Foz(i, a) For(i, 0, a)
#define Doz(i, a) Dor(i, 0, a)
#define Trav(e, v) for (auto& e : v)
#define pb push_back
#define mp make_pair
#define all(x) begin(x), end(x)
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vii = vector<ii>;
template <typename T> bool ckmin (T& a, T b) { return (b < a) ? a = b, 1 : 0; }
template <typename T> bool ckmax (T& a, T b) { return (b > a) ? a = b, 1 : 0; }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#ifdef XVENOM
	#define errp(...) fprintf(stderr, __VA_ARGS__)
	#define dbg(...) errp("[%s]: ", #__VA_ARGS__), dbg_str(__VA_ARGS__)
#else
	#define errp(...)
	#define dbg(...)
#endif
template <typename U, typename V> string to_string (pair<U, V>);
string to_string (string& e) { return "\"" + e + "\""; }
string to_string (char e) { return "\'" + string(1, e) + "\'"; }
string to_string (bool e) { return e ? "true" : "false"; }
template <typename T> string to_string (T e) {
	string s = "[ ";
	for (auto& x : e) s += to_string(x) + " ";
	return s + "]";
}
template <typename U, typename V> string to_string (pair<U, V> e) {
	return "(" + to_string(e.first) + ", " + to_string(e.second) + ")";
}
void dbg_str () { errp(" \n"); }
template <typename U, typename... V> void dbg_str (U u, V... v) {
 	errp(" %s", to_string(u).c_str()); dbg_str(v...);
}
/* --- */
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	/* --- */
	int n, k, q;
	cin >> n >> k >> q;
	vi s(n + 1, k);
	int x;
	Foz(i, q) {
		cin >> x;
		s[x]++;
	}
	For(i, 1, n + 1) {
		cout << (s[i] > q ? "Yes" : "No") << '\n';
	}
}



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

#define REP(i,n) for(int i=0; i < (n); ++i)
#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)

#define INF 1e9

ll fn(ll n){
  if(n < 2){
    return 1;
  }
  return n * fn(n-2);
}

int main(){
  ll N;
  cin >> N;
  if(N<2 || N%2 == 1){
    cout << 0 << endl;
    return 0;
  }
  ll five = 5, ans = 0;
  while( five <= N){
    ll syo = N / five;
    ll add= syo/2;
    ans += add;
    five *= 5;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using LL = long long int;
#define incID(i, l, r) for(int i = (l)    ; i <  (r); ++i)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); --i)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); ++i)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); --i)
#define inc(i, n)  incID(i, 0, n)
#define dec(i, n)  decID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec1(i, n) decII(i, 1, n)
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))
#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define FR front()
#define BA back()
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
auto setmin   = [](auto & a, auto b) { return (b <  a ? a = b, true : false); };
auto setmax   = [](auto & a, auto b) { return (b >  a ? a = b, true : false); };
auto setmineq = [](auto & a, auto b) { return (b <= a ? a = b, true : false); };
auto setmaxeq = [](auto & a, auto b) { return (b >= a ? a = b, true : false); };
#define SI(v) static_cast<int>(v.size())
#define RF(e, v) for(auto & e: v)
#define until(e) while(! (e))
#define if_not(e) if(! (e))
#define ef else if
#define UR assert(false)
#define IN(T, ...) T __VA_ARGS__; IN_(__VA_ARGS__);
void IN_() { };
template<typename T, typename ... U> void IN_(T & a, U & ... b) { cin >> a; IN_(b ...); };
template<typename T> void OUT(T && a) { cout << a << endl; }
template<typename T, typename ... U> void OUT(T && a, U && ... b) { cout << a << " "; OUT(b ...); }

// ---- ----

int main() {
	IN(int, a, b);
	inc1(i, 100000) {
		if(i * 8 / 100 == a && i * 10 / 100 == b) { OUT(i); exit(0); }
	}
	OUT(-1);
}


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

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(itr,v) for(auto &(itr):(v))
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())

typedef long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<bool> vb;
typedef vector<ld> vld;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

int n, res;
string s[300];

signed main() {
	cin >> n;
	rep(i,n) cin >> s[i];
	rep(a,n) {
		string t[300] = {};
		rep(i,n) rep(j,n) t[i].pb(s[(i+a)%n][j%n]);
		bool k = 1;
		rep(i,n) rep(j,n) if (t[i][j]!=t[j][i]) k = 0;
		if (k) res += n;
	}
	cout << res << ln;
}

Measured memory_bytes: 588
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	h := make([]int, n)
	for i, _ := range h {
		fmt.Scan(&h[i])
	}

	ans := 0
	temp := 0
	for i := 0; i < n-1; i++ {
		if h[i] >= h[i+1] {
			temp++
			if i == n-2 {
				ans = max(ans, temp)
			}
		} else {
			ans = max(ans, temp)
			temp = 0
		}
	}
	fmt.Println(ans)

}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

Measured memory_bytes: 7296
#include<math.h>
#include<stdio.h>

int main(){
	int hishi=0,tyo=0,hen1,hen2,tai;
	
	while(0<=scanf("%d,%d,%d",&hen1,&hen2,&tai)){
		if(hen1==hen2){
			++hishi;
		}
		
		if(pow((double)hen1,2)+pow((double)hen2,2)==pow((double)tai,2)){
			++tyo;
		}
	}
	
	printf("%d\n%d\n",tyo,hishi);
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long int n,i,sum = 0;
   cin>>n;
   while(n>1)
   {

       n /= 2;
       sum++;
   }
   long long int res = 0;
   for(i = 0;i <=sum;i++)
    res += pow(2,i);
   cout<<res<<endl;
   return 0;
}


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

int main() {
  int A, B;
  cin >> A >> B;
  if (A < B) {
    for (int i = 0; i < B; i++) cout << A;
    cout << endl;
  }
  else {
    for (int i = 0; i < A; i++) cout << B;
    cout << endl;
  }
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define REP(i, n) for(ll i = 0;i < n;i++)
#define ll long long
#define MOD 1000000007LL
#define llMAX 9223372036854775807LL
#define llMIN -9223372036854775808LL
using vi = vector<ll>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける

ll n,k,x,y;

int main(){
  ll ans=0;
  cin >> x>>y;
  if (y%2==1){
    cout<<"No"<<endl;
    return 0;
  }

  if ((y<x*2)|(x*4<y)){
    cout<<"No"<<endl;
    return 0;
  }

  cout<<"Yes"<<endl;
  return 0;
}

/*
#include "bits/stdc++.h"
using namespace std;
#define REP(i, n) for(ll i = 0;i < n;i++)
#define ll long long
#define MOD 1000000007LL
#define llMAX 9223372036854775807LL
#define llMIN -9223372036854775808LL
using vi = vector<ll>; // intの1次元の型に vi という別名をつける
using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける

ll n,k,x,y;

int main(){
  ll ans=0;
  cin >> n >> k;
  string s;cin>>s;
  vi a(n),b(n);
  REP(i,n) cin>>a[i];
  cout<<ans<<endl;
  return 0;
}
*/

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

int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	int abc=a*100+b*10+c;
	if(abc%4==0){
		cout<<"YES";
	}
	else{
		cout<<"NO";
	}
    return 0;
}


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

template <class Abel> struct BIT {
	vector<Abel> dat;
	Abel UNITY_SUM = 0;

	// [1, n]
	BIT(int n) {
		dat.resize(n+1);
		for(int i=0;i<(int)dat.size();i++) {
			dat[i] = UNITY_SUM;
		}
	}

	// a is 1-indexed
	inline void add(int a, Abel x) {
		for(int i=a;i<(int)dat.size();i += i & -i) {
			dat[i] = dat[i] + x;
		}
	}

	// [1, a], a is 1-indexed
	inline Abel sum(int a) {
		Abel res = UNITY_SUM;
		for(int i=a;i>0;i -= i & -i) {
			res += dat[i];
		}
		return res;
	}

	// [a, b), a and b are 1-indexed
	inline Abel sum(int a, int b) {
		return sum(b - 1) - sum(a - 1);
	}
};

int main() {
	int N;
	ll K;
	cin >> N >> K;
	vector<ll> A(N);
	for(auto &a : A) cin >> a;
	
	vector<ll> B(N+1, 0), C(N+1, 0);
	for(int i=1;i<=N;i++) {
		B[i] = B[i-1] + A[i-1];
	}
	for(int i=1;i<=N;i++) {
		B[i] -= (i * K);
		C[i] = B[i];
	}
	
	sort(C.begin(), C.end());
	C.erase(unique(C.begin(), C.end()), C.end());

	// 0 <= j < i <= Nのとき, Bi >= Bjの個数
	ll ans = 0;
	BIT<ll> bit(N+1);
	bit.add((int)(lower_bound(C.begin(), C.end(), 0) - C.begin()) + 1, 1);
	for(int i=1;i<=N;i++) {
		int b = (int)(lower_bound(C.begin(), C.end(), B[i]) - C.begin()) + 1;
		ans += bit.sum(b);
		bit.add(b, 1);
	}
	cout << ans << endl;
}

Measured memory_bytes: 6528
object Main {
  def main(args: Array[String]): Unit = {
    val s = new Main()
    s.solve()
    s.out.flush()
  }
}

class Main {
  import java.io._
  import java.util.StringTokenizer

  import scala.collection.mutable
  import scala.util.Sorting
  import math.{abs, max, min}
  import mutable.{ArrayBuffer, ListBuffer}
  import scala.reflect.ClassTag

  val MOD = 1000000007
  val out = new PrintWriter(System.out)

  def solve(): Unit = {
    val N, K = ni()
    val A = na(N)
    val dp = Array.ofDim[Boolean](K + 1)
    dp(0) = false

    REP(K, 1) { k =>
      var win = false
      REP(N) { i =>
        if (k - A(i) >= 0) win ||= !dp(k - A(i))
      }
      dp(k) = win
    }

    if (dp(K)) out.println("First")
    else out.println("Second")
  }

  def debug(s: Any): Unit = {
    System.err.println(s)
  }

  class InputReader(val stream: InputStream) {
    private val reader = new BufferedReader(new InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer = _

    def next(): String = {
      while (tokenizer == null || !tokenizer.hasMoreTokens)
        tokenizer = new StringTokenizer(reader.readLine)
      tokenizer.nextToken
    }

    def nextInt(): Int = next().toInt
    def nextLong(): Long = next().toLong
    def nextChar(): Char = next().charAt(0)
  }
  val sc = new InputReader(System.in)
  def ni(): Int = sc.nextInt()
  def nl(): Long = sc.nextLong()
  def nc(): Char = sc.nextChar()
  def ns(): String = sc.next()
  def ns(n: Int): Array[Char] = ns().toCharArray
  def na(n: Int, offset: Int = 0): Array[Int] = map(n)(_ => ni() + offset)
  def na2(n: Int, offset: Int = 0): (Array[Int], Array[Int]) = {
    val A1, A2 = Array.ofDim[Int](n)
    REP(n) { i =>
      A1(i) = ni() + offset
      A2(i) = ni() + offset
    }
    (A1, A2)
  }
  def nm(n: Int, m: Int): Array[Array[Int]] = {
    val A = Array.ofDim[Int](n, m)
    REP(n) { i =>
      REP(m) { j =>
        A(i)(j) = ni()
      }
    }
    A
  }
  def nal(n: Int): Array[Long] = map(n)(_ => nl())
  def nm_c(n: Int, m: Int): Array[Array[Char]] = map(n) (_ => ns(m))
  def REP(n: Int, offset: Int = 0)(f: Int => Unit): Unit = {
    var i = offset
    val N = n + offset
    while(i < N) { f(i); i += 1 }
  }
  def REP_r(n: Int, offset: Int = 0)(f: Int => Unit): Unit = {
    var i = n - 1 + offset
    while(i >= offset) { f(i); i -= 1 }
  }

  def map[@specialized A: ClassTag](n: Int, offset: Int = 0)(f: Int => A): Array[A] = {
    val res = Array.ofDim[A](n)
    REP(n)(i => res(i) = f(i + offset))
    res
  }


  def sumL(as: Array[Int]): Long = {
    var s = 0L
    REP(as.length)(i => s += as(i))
    s
  }

  def cumSum(as: Array[Int]) = {
    val cum = Array.ofDim[Long](as.length + 1)
    REP(as.length) { i =>
      cum(i + 1) = cum(i) + as(i)
    }
    cum
  }
}


Measured memory_bytes: 31288
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long LL;

int main() {
  LL X; cin >> X;
  LL coin = 100;
  int cnt = 0;
  while (coin < X) {
    ++cnt;
    coin = coin * 1.01;
  }
  cout << cnt << endl;
}


Measured memory_bytes: 3636
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <chrono>
#include <random>
#include <cmath>
using namespace std;
using namespace __gnu_pbds;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define uid uniform_int_distribution<lli>
#define lli long long int
#define ff first
#define ss second
#define pb push_back
#define popf pop_front()
#define popb pop_back()
#define all(vec) vec.begin(), vec.end()
#define fol(i,a,b) for(int i=a;i<b;i++)
#define forr(x,arr) for(auto& x:arr)
#define sz(x) (x.size())
#define mod 1000000007
#define INF 1000000000000000010
#define vi vector<int>
#define vlli vector<lli>
#define endl "\n"
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef tree<lli,null_type,less<lli>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

template <class my>
inline my aabs (const my &a)   { return (a > 0)  ? a : -a;         }
inline lli gcd(lli a, lli b)   { return (b == 0) ? a : gcd(b,a%b); }
inline lli LSOne(lli k)        { return (k&(-k));                  }

inline int inv(lli o, int m = mod) {
  int b = m, u = 0, v = 1, t, a=o%m;
  while (a) {
    t = b / a;
    b -= t * a; swap(a, b);
    u -= t * v; swap(u, v);
  }
  if (u < 0) u += m;
  return u;
}
inline int add(const int &a, const int &b, int m=mod) { return a + b >= m ? a + b - m : a + b; }
inline int sub(const int &a, const int &b, int m=mod) { return a - b < 0 ? a - b + m : a - b; }
inline int mul(const int &a, const int &b, int m=mod) { return int(a * 1ll * b % m); }
inline int pow(int a, int b, int m=mod) {
    int ans = 1;
    a=((a%m)+m)%m;
    while (b) {
        if (b & 1) ans = mul(ans, a, m);
        a = mul(a, a, m);
        b >>= 1;
    }
    return ans;
}

void solve()
{
    lli n, m, t, k=0, q, temp=0, u=0, v=0, ans1=0, ans2=0, val=0, sum=0;
    cin>>n>>u>>v;
    cout<<min(n*u,v)<<endl;
}

int main()
{
    fastio cout<<endl;
    cout << fixed << setprecision(7);
    int t=1;
    //cin>>t;
    while(t--)
        solve();
}

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

int main(){
    int n;
    cin >> n;
    vector<int>v(n);
    rep(i,n) cin >> v[i];
    sort(v.begin(),v.end());
    int cnt=0,l=0;
    if(v[0]>=3200)l++;
    else cnt++;
    for(int i = 1;i < n;i++){
        if(v[i]>=3200)l++;
        else if(v[i-1]/400<v[i]/400)cnt++;
    }
    cout << max(1,cnt) << ' ' << l+cnt << endl;
    return 0;
}

Measured memory_bytes: 256
def main():
    N, A, B = map(int, input().split())
    if A > B:
        return 0
    if N == 1:
        if A != B:
            return 0
        else:
            return 1
    if N == 2:
        return 1

    mn = A * (N - 1) + B
    mx = A + B * (N - 1)
    return mx - mn + 1


if __name__ == "__main__":
    print(main())

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

int main(){
    int n; cin >> n;
    for(int i=1; i<=n; i++){
        if(i%3 == 0){
            cout << " " << i;
        }else{
            string s = to_string(i);
            for(auto c: s) if(c == '3'){
                cout << " " << i;
                break;
            }
        }
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 3260
#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 watch(x) cout<<(#x)<<"="<<(x)<<'\n'
#define mset(d,val) memset(d,val,sizeof(d))
#define setp(x) cout<<fixed<<setprecision(x)
#define forn(i,a,b) for(int i=a;i<b;i++)
#define fore(i,a,b) for(int i=a;i<=b;i++)
#define pb push_back
#define F first
#define S second
#define INF ll(1e18)
#define MOD 998244353
#define pqueue priority_queue
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef long double ld;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;

#define MAXN 100005

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	int n,m; cin>>n>>m;
	if(n==m) cout<<"Yes\n";
	else cout<<"No\n";
	
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>

int m,nmin,nmax;
int P[205];
int diff[205];

int main(){

    while(scanf("%d%d%d",&m,&nmin,&nmax)&&m&&nmin&&nmax){
        for(int i=1;i<=m;i++) scanf("%d",P+i);
        for(int i=1;i<=m-1;i++) diff[i]=P[i]-P[i+1];

        int ans=nmax,difference=diff[ans];
        for(int i=nmax;i>=nmin;i--)
            if (diff[i]>difference) ans=i,difference=diff[i];

        printf("%d\n",ans);
    }


    return 0;
}


Measured memory_bytes: 2596
#include <stdio.h>
const int MAX_V = 1000000; // 100????????§??´???°??¨?????????
int number[MAX_V+1];
int isprime(int n) {
 for(int i = 2; i * i <= n; i++) {
	 if(n % i == 0) return 0;
 }
 return 1;
}

int main(){
	int n,i,min,max;
	for(i = 0;i < MAX_V;i++){
		number[i] = isprime(i);
	}
	while(scanf("%d",&n)){
		if(n == 0)break;
		max = 0; min = 0;
		for(i = n;i > 0;i--){
			//printf("%d  ",i);
			if(number[i] && number[i-2]){
				min = i-2;
				max = i;
				//printf("%d %d\n",i,i-2);
				break;
			}
		}
		printf("%d %d\n",min,max);
	}
	return 0;
}

Measured memory_bytes: 4932
a,b,c=gets.chomp.split(" ").map(&:to_i)
if a%2==1 or b%2==1 or c%2==1
  puts 0
elsif a==b and b==c
  puts "-1"
else
  ans=0
  until a%2==1 or b%2==1 or c%2==1
    a,b,c=b/2+c/2,a/2+c/2,a/2+c/2
    ans+=1
  end
  puts ans
end


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

int main(void){
  int n;
  vector<int> v(20), c(20);

  cin >> n;
  for(int i = 0; i < n; i ++){
    cin >> v.at(i);
  }
  for(int i = 0; i < n; i ++){
    cin >> c.at(i);
  }

  int res = 0;
  for(int i = 0; i < n; i++){
    if(v.at(i) > c.at(i)){
      res += (v.at(i) - c.at(i));
    }
  }

  cout << res << endl;

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store") // to restrict undesirable precision
#pragma GCC optimize ("-fno-defer-pop")// to pop argument of function as soon as it returns
#define all(a) a.begin(),a.end()
#define ll long long int
#define ld long double
ll power(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=power(a,b/2,m)%m; t=(t*t)%m; if(b&1) t=((t%m)*(a%m))%m; return t;}
ll modInverse(ll a, ll m) { return power(a, m-2, m); }
#define ps push_back
#define fs first
#define takeline cin.ignore();
#define sc second
#define N 3000005
#define endl "\n"
#define mod 1000000007
//((1.0l)*BIG MULTIPLY MAGIC?)
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
//-----------------------------------------------
int main(){

	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	
	string s;
	cin>>s;
	if(s=="SUN"){
		cout<<"7";
	}
	else if(s=="MON"){
		cout<<"6";
	}
	else if(s=="TUE"){
		cout<<"5";
	}
	else if(s=="WED"){
		cout<<"4";
	}
	else if(s=="THU"){
		cout<<"3";
	}
	else if(s=="FRI"){
		cout<<"2";
	}
	else{
		cout<<"1";
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
const ll MAX = 1001001;
const ll MOD = 1000000007;
int main()
{
    ll n, k;
    cin >> n >> k;
    ll j = -1;
    vector<ll> a(n);
    rep(i, n)
    {
        cin >> a[i];
    }
    rep(i, n - 1)
    {
        if (a[i] + a[i + 1] >= k)
        {
            j = i;
        }
    }
    vector<ll> ans;
    if (j >= 0)
    {
        cout << "Possible" << endl;
        rep2(i, 1, j + 1)
        {
            ans.push_back(i);
        }
        for (ll i = n - 1; i > j; i--)
        {
            ans.push_back(i);
        }

        rep(i, n - 1)
        {
            cout << ans[i] << endl;
        }
    }
    else
    {
        cout << "Impossible" << endl;
    }
}

Measured memory_bytes: 5112
#include <iostream>
#include <cstdio>
using namespace std;
string s;
int main(){
	cin>>s;
	for(int i=0;i<5;i++) cout<<s[i];
	cout<<' ';
	for(int i=6;i<13;i++) cout<<s[i];
	cout<<' ';
	for(int i=14;i<19;i++) cout<<s[i];
} 

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
int check(int k)
{
	int x=0,z=0;
	while (k>0)
	{
		x=k%10+x*10;
		k=k/10;
	}
	return x;
}
int main()
{
	int n,m;
	int ans=0;
	scanf("%d%d",&n,&m);
	for (int i=n;i<=m;i++)
	    if (check(i)==i) ans++;
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <functional>
using namespace std;

int main(){
	int a[100],b[100],buf,i;
	for(i = 0;i < 100;i++) a[i] = 0;
	while(scanf("%d",&buf) != EOF){
		a[buf - 1]++;
	}
	for(i = 0;i < 100;i++){
		b[i] = a[i];
	}
	sort(a,a + 100,greater<int>());
	for(i = 0;i < 100;i++){
		if(b[i] == a[0]) printf("%d\n",i + 1);
	}
	return 0;
}

Measured memory_bytes: 1040
#include<math.h>
#include<limits.h>
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<sstream>
#include<list>
#include<queue>
#include <algorithm>
#include<initializer_list>
#include<map>
#include<set>
using namespace std;

int main() {
	int n;
	string s;
	int r, g;
	cin >> r;
	cin >> g;
	cout << 2 * g - r;

	return 0;
}





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

int main(){
    int n;
    cin>>n;
    vector<int> a(n),b(n),c(n),d(n);
    vector<pair<int,int>> ab(n);
    vector<int> used(n,false);
    for(int i=0;i<n;i++) cin>>a[i]>>b[i];
    for(int i=0;i<n;i++) cin>>c[i]>>d[i];
    for(int i=0;i<n;i++) ab[i]={a[i],b[i]};
    sort(ab.begin(),ab.end(),greater<pair<int,int>>());
    for(int i=0;i<n;i++){
        a[i]=ab[i].first;
        b[i]=ab[i].second;
    }
    int res=0;
    for(int i=0;i<n;i++){
        int inde=-1;
        for(int j=0;j<n;j++){
            if(!used[j] && a[i]<c[j] && b[i]<d[j]){
                if(inde==-1){
                    inde=j;
                }
                else if(d[j]<d[inde]){
                    inde=j;
                }
            }
        }
        if(inde!=-1){
            res++;
            used[inde]=true;
        }
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using ull=unsigned long long int;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
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 (a>b) { a=b; return 1; } return 0; }
int main(){
 int n,h,w;
 cin>>n>>h>>w;
 V<int> a(n);
 for(int i=0;i<n;i++)cin>>a[i];
 V<bool> odd(n*w,false),even(n*w,false);
 for(int i=0;i<n;i+=2){
   ll now=i*w;
   for(int j=0;j<w;j++){
     odd[now+a[i]+j]=true;
   }
 }
 for(int i=1;i<n;i+=2){
   ll now=(i+1)*w-1;
   for(int j=0;j<w;j++){
     even[now-a[i]-j]=true;
   }
 }
 ll sum=0;
 for(int i=0;i<n*w;i++){
   if(!odd[i]&&!even[i])sum++;
 }
 cout<<sum*h<<"\n";
}


Measured memory_bytes: 3240
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10

#N, K = [int(x) for x in stdin.readline().rstrip().split()]
S = stdin.readline().rstrip()
T = stdin.readline().rstrip()

if S[:] == T[:-1]:
    print("Yes")
else:
    print("No")





Measured memory_bytes: 72700
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long int ll;

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

void P(int x) {cout << x << endl;}
void P(long x) {cout << x << endl;}
void P(ll x) {cout << x << endl;}
void P(string x) {cout << x << endl;}

#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define drep(i, n) for(int i = n - 1; i >= 0; i--)

const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;

int main() {
  int n;
  string s;
  cin >> n >> s;
  map<char, vector<int>> mp;
  rep (i, s.size()) {
    mp[s[i]].push_back(i + 1);
  }
  ll ans = 0;
  auto itr = mp.find('R');
  int flag = 0;

  ans = mp['R'].size() * mp['G'].size() * mp['B'].size();

  ll minus = 0;
  for (int i = 1; i < s.size(); i++) {
    for (int j = 0; j < s.size(); j++) {
      if (j + i * 2 >= s.size()) break;
      if (s[j] != s[j + i] && s[j] != s[j + i * 2] && s[j + i] != s[j + i * 2]) minus++;
    }
  }
  P(ans - minus);
  return 0;


  return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

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

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))


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

    int n;
    cin >> n;

    vs32 a(n);
    rep (i, n) cin >> a[i];

    vs32 ans;
    ans.push_back(-a[0]);
    for (int i = 1; i < n; ++i)
    {
        auto it = upper_bound(ans.begin(), ans.end(), -a[i]);
        if (it == ans.end()) ans.push_back(-a[i]);
        else *it = -a[i];
    }

    cout << ans.size() << "\n";
    return 0;
}



Measured memory_bytes: 1276
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#include <limits.h>

using namespace std;

typedef long long ll;

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

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

int pow(int base, int n) {
    if (n <= 0) return 1;
    else return base * pow(base, n - 1);
}

int main(void) {
    int D, N;
    cin >> D >> N;

    if (N == 100) N++;
    cout << pow(100, D) * N << endl;

    return 0;
}


Measured memory_bytes: 256
/*

n=100

如果用x维正向的，就全用。
但是对于选择来说不独立

Δ1：二维距离，二维独立
顺序:
如果单独考虑最后的四种符号
是否可以将该问题化为二维距离最大的经典问题

如果第二维较小的话，可以一维花费一维收益

二维确定之后，完全相反的肯定不拿，完全相同的肯定拿
剩下的就是增加一个减小另一个

*/
#include<bits/stdc++.h>
#define y second
#define x first
using namespace std;
typedef long long ll;
const ll MAXN=205;
ll n,xsum[MAXN],ysum[MAXN];
pair<ll,ll>p[MAXN];
bool cmp(pair<ll,ll> a,pair<ll,ll> b)
{
    if(atan2(a.y,a.x)!=atan2(b.y,b.x))
    return atan2(a.y,a.x)<atan2(b.y,b.x);
    else return a.x<b.x;
}
ll len(ll detx,ll dety)
{
    return (detx*detx+dety*dety);
}
void solve()
{
    sort(p+1,p+1+n,cmp);

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

        p[i+n]=p[i];
    }

    for(ll i=1;i<=2*n;i++)
    {
        xsum[i]=xsum[i-1]+p[i].first;
        ysum[i]=ysum[i-1]+p[i].second;
    }

    ll ans=0;
    for(ll i=1;i<=n;i++)
    {
        for(ll j=i;j<i+n;j++)
        {
            ll xx=xsum[j+1]-xsum[i];
            ll yy=ysum[j+1]-ysum[i];
            ans=max(ans,len(xx,yy));
        }
    }

    printf("%.15f\n",sqrt(ans));
}
int main()
{
    scanf("%lld",&n);
    for(ll i=1;i<=n;i++)
    {
        scanf("%lld %lld",&p[i].first,&p[i].second);
    }
    solve();
}
/*
3
8 60
2 9 12 15 16 21 25 40
8 90
2 36 44 49 50 63 64 81
8 138600
40 2200 45 216 175 735 15 36

*/


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PLL = pair<ll, ll>;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repn(i,n) for(int i = 0; i <= (int)(n); i++)
#define srep(i,l,n) for(int i = l; i < (int)(n); i++)
#define srepn(i,l,n) for(int i = l; i <= (int)(n); i++)
#define drep(i,n) for(int i = (int)(n-1); i >= 0; i--)
#define drepn(i,n) for(int i = (int)(n); i >= 0; i--)
#define size(s) (int)s.size()
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
template<typename T> inline istream& operator>>(istream &i, vector<T> &v) {rep(j, size(v)) i >> v[j]; return i;}
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; }
template<class T> T gcd(T a, T b) {if(b==0)return a; else return gcd(b,a%b);}
template<class T> T lcm(T a, T b) {return a/gcd(a,b)*b;}
template<class T = int> using V = vector<T>;
template<class T = int> using VV = vector<V<T>>;
bool isIn(int i, int j, int h, int w) {return i >= 0 && i < h && j >= 0 && j < w;}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void err() {cout << -1 << endl;}
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define ep emplace_back

const int MOD = 1000000007;
const int INF = 1e9;

#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};

const int mx = 1e4 + 4;
vector<int> a(mx, 0);

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    for(int i = 1; i <= 100; i++) {
        for(int j = 1; j <= 100; j++) {
            for(int k = 1; k <= 100; k++) {
                int now = i * i + j * j + k * k + i * j + j * k + k * i;
                if(1 <= now && now <= n) {
                    a[now]++;
                }
            }
        }
    }
    for(int i = 1; i <= n; i++) {
        cout << a[i] << '\n';
    }
}

Measured memory_bytes: 3584
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <valarray>
#include <vector>
using namespace std;
int a[100005],b[100005],c[100005];
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(int i=0;i<n;i++)
	{
		cin>>b[i];
	}
	for(int i=0;i<n;i++)
	{
		cin>>c[i];
	}
	sort(a,a+n);
	sort(b,b+n);
	sort(c,c+n);
	int point1=0,point2=0;
	long long ans=0;
	for(int i=0;i<n;i++)
	{
		while(point1<n&&a[point1]<b[i])
		point1++;
		while(point2<n&&c[point2]<=b[i])
		point2++;
		ans+=(point1)*1ll*(n-point2);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1408
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>

using namespace std;
#define int long long

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
//SOLVE

template< typename T >
using Matrix = vector< vector< T > >;

template< typename T >
void warshall_floyd(Matrix< T > &g) {
  for(int k = 0; k < g.size(); k++) {
    for(int i = 0; i < g.size(); i++) {
      for(int j = 0; j < g.size(); j++) {
        if(g[i][k] == INF || g[k][j] == INF) continue;
        g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
      }
    }
  }
}


void solve(void)
{
  int N,M;
  cin>>N>>M;
  Matrix<int> MAT(N,vector<int>(N,INF));
  vector<vector<int> > GRAPH(M,vector<int>(3,0));
  for (int i = 0; i < M; i++)
  {
    int A,B,C;
    cin>>A>>B>>C;
    A--;B--;
    MAT[A][B] = C;
    MAT[B][A] = C;
    GRAPH[i][0] = A;
    GRAPH[i][1] = B;
    GRAPH[i][2] = C;
  }
  auto cpMAT = MAT;
  for (int i = 0; i < N; i++)
  {
    MAT[i][i] = 0;
  }

  warshall_floyd(MAT);
  int cnt = 0;
  for (int m = 0; m < M; m++)
  {
    int S = GRAPH[m][0];
    int T = GRAPH[m][1];
    int C = GRAPH[m][2];
    int check = 0;
    for (int i = 0; i < N; i++)
    {
      if(MAT[i][S] + C == MAT[i][T])check = 1;
    }
    if(check == 0)cnt++;
  }
  cout<<cnt<<endl;;
  
  
  
  return;
}
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


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

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

int main() {
    int N,M;
    cin >> N >> M;
    vector<int> vec(N);
    int p;
    for (int i = 0; i < M * 2; ++i) {
        cin >> p;
        vec.at(p - 1) += 1;
    }
    for (int j = 0; j < vec.size(); ++j) {
        cout << vec.at(j) << endl;
    }
}



Measured memory_bytes: 256