stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

long long N;

int main(){

	scanf("%lld",&N);

long long sum=0,m;

m=N;

while(N){

	sum+=N%10;

	N/=10;

}

if(m%sum==0)

printf("Yes\n");

else

printf("No\n");







}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



using namespace std;



int main(){

  int n, sum=0;

  cin >> n;

  int aux = n;

  while(n>0){

    sum+=n%10;

    n/=10;

  }

  if(aux%sum==0)

    cout << "Yes" << endl;

  else

    cout << "No" << endl;

  return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



#define ll long long



using namespace std;



int sum(int a){

    if(a < 10) return a;

    return sum(a/10) + a%10;    

}



int main(){

    int a, b, c;



    cin >> a;



    if(!(a%sum(a))) cout << "Yes\n";

    else cout << "No\n";



    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



int digits_sum(int N)

{

	int sum = 0;

	

	while  (N > 0)

	{

		int d = N % 10;

		N /= 10;

		

		sum += d;

	}

	

	return sum;

}



int main(){

    int n;

    cin>>n;

    

    if(n % digits_sum(n) == 0)

        cout<<"Yes";

    else

        cout<<"No";



    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

int j,sum;



int dig(int l);



int main(){



int n;

cin >>n;

if (n%dig(n)==0){cout << "Yes" << endl;}

else {cout << "No" << endl;}





return 0;

}



int dig(int l){



while (l>0){



    j=l%10;

    sum+=j;

    l = l/10;

}

return sum;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
/*

R         R R R R        R        R R R      R      R    R    R      R    R R R R                                                     

R         R             R R       R    RR    R R    R    R    R R    R    R              

R         R            R   R      R R R      R  R   R    R    R  R   R    R   R R                 

R         R R R       R R R R     R R        R   R  R    R    R   R  R    R     R                       

R         R          R       R    R   RR     R    R R    R    R    R R    R     R           

R R R R   R R R R   R         R   R     RR   R      R    R    R      R    R R R R               



*/





#include<bits/stdc++.h>

using namespace std;

#define  bf            ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#define  ll            long long

#define  pb            push_back

#define  pr            10

#define  mx            100000 // 10^6

#define  md            1000000007

#define  result(a)     cout<<a<<endl;

#define  forr(a,x)     for(int i=a;i<=x;i++)

#define  input(n,a)    int a[n];for(int i=0;i<n;i++)cin>>a[i];

#define  print(a)      for(auto it:a)cout<<it<<' '; //0-based 

#define  printt(n,a)   for(i=0;i<n;i++)cout<<a[i]<<' '; //1-based 

#define  sz(a)         cout<<a.size()<<endl; 

#define  prefx(n,a)    for(i=1;i<n;i++)a[i]=a[i-1]+a[i]; //0-based

#define  sortt(v)      sort(v.begin(),v.end());

#define  srt(n,a)      sort(a,a+n);

#define  rev(n,a)      reverse(a,a+n);

#define  revr(a)       reverse(a.begin(),a.end());

#define  yes           cout<<"yes\n";

#define  no            cout<<"no\n";



int main()

{

  int N,sum=0,tmp=0;

	scanf("%d", &N);

  tmp = N;

	while (tmp > 0) {

		sum += tmp % 10;

		tmp /= 10;

	}

	if (N % sum == 0) {

		puts("Yes");

	} else {

		puts("No");

	}

	return 0;

  

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

int main(){

ll n,temp,sum=0,r=0;

cin>>n;

temp=n;

while(temp!=0)

{

    r=temp%10;

    sum+=r;

    temp=temp/10;

}

if(n%sum==0) cout<<"Yes"<<endl;

else cout<<"No"<<endl;

return 0;

}




// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <string>

using namespace std;

int main()

{

    string s;

    cin >> s;

    int sum = 0;

    for(int i=0;i<s.size();i++)

    {

        sum += s[i]-48;

    }

    /// cout << sum << endl;

    int n;

    n = stoi(s);

    if(n%sum==0)

    {

        cout << "Yes" << endl;

    }

    else cout << "No" << endl;



}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;



#define print(x) cout << #x << '=' << x << endl





int main()

{

	int N;

	cin >> N;



	int M= N, sum=0;

	while(M!=0)

	{

		sum += M%10;

		M=M/10;

	}

	// print(sum);

	if(N%sum==0)

		cout << "Yes\n";

	else 

		cout << "No\n";

   	return 0;

}




// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;

void solve();

int main()

{

    long long int n,x,sum=0;

    cin >> n;

    x=n;

    while(x>0)

    {

        sum+=(x%10);

        x/=10;

    }

    if(n%sum==0)

        cout << "Yes";

    else cout << "No";

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define   nl   <<'\n'

#define   pi   acos(-1.0);

#define   ll   long long

#define   pb   push_back

#define   eb   emplace_back

#define   tc   int t; cin>>t; while(t--)

#define   fio  ios_base::sync_with_stdio(0); cin.tie(0)



int main()

{

    ll n;

    cin>>n;

    ll c=0,s=n;

    while(1)

    {

        c+=s%10;

        s/=10;

        if(!s) break;

    }

    if(n%c) cout<<"No\n";

    else cout<<"Yes\n";

}  

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define pb       push_back

#define mp       make_pair

#define mod      1000000007

#define first    ff

#define second   ss

#define pi       acos(-1.0)

#define test     int t;cin>>t;while(t--)

typedef long long ll;

using namespace std;

int a[28],b[28];



int main()

{      

     ios::sync_with_stdio(false);

     cin.tie(NULL);

     cout.tie(NULL);

     

      ll n,cnt=0;

     

     cin>>n;

     string s;

     s=to_string(n);



     for(int i=0;i<s.size();i++)

       cnt+=(s[i]-'0');

     if(n%cnt)

      cout<<"No"<<endl;

     else

      cout<<"Yes"<<endl;





      return 0;

      

 }       


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

#define ll long long



int main()

{

    ll n,i,sum=0;

    cin>>n;i=n;

    while(n)

    {

        sum+=n%10;

        n/=10;

    }

    if(i%sum==0) cout<<"Yes";

    else cout<<"No";

    cout<<endl;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
/* *Your Love Makes me STRONG,

   You'r Hate Makes Me UNSTOPABBLE.*

 

  *HOPE is a good thing,Maybe The BEST of Things.

   And No Good Things Ever Dies.*

  

  *Keep calm,Be patient And Chase Your DREAM*



*/





#include<bits/stdc++.h>

#define ll long long

#define pb push_back

#define MN7 ios::sync_with_stdio(0);cin.tie(nullptr);

using namespace std;

ll t,n,i,j,k,a,b,c,d,p,q,r,x,y,z,m,cnt,flag,ans;

string s;

void nahid()

{

 cin>>n;

 m=n;

 while(n)

 {

 	ans+=n%10;

 	n/=10;

 }

 if(m%ans)cout<<"No"<<endl;

 else cout<<"Yes"<<endl;

}

int main()

{ MN7 //cin>>t;while(t--)

  nahid();

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <string.h>



using namespace std;



long long strint(char f[])

{

    long long a=0,i,b,j,c=1;

    int o=strlen(f);

    for(i=strlen(f)-1; i>=0; i--)

    {

        b=f[i]-48;

        if(i==strlen(f)-1)

        {

            a+=b;

        }



        else

        {

            for(j=0; j<c; j++)

            {

                b*=10;

            }

            a+=b;

            c++;

        }

    }

    return a;

}



int main()

{

	char str[20];

	long long num,lol;

	int sum = 0;

	cin >> str;

	num = strint(str);

	lol = num;

	int len = strlen(str);

	for(int i = 0; i < len; i++)

	{

		sum += num%10;

		num = num/10;

	}

	if (lol%sum == 0)

		cout << "Yes" << endl;

	else

		cout << "No" << endl;



	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	int n;

	cin>>n;

	long long int sum = 0;

	int temp = n;



	while(temp!=0)

	{

		sum+=(temp%10);

		temp/=10;

	}



	if(n%sum==0)

		cout<<"Yes"<<endl;

	else 

		cout<<"No"<<endl;



	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;

int main(){

string s,temp;

cin>>s;

temp=s;

ll sum=0,n;

n=stoi(s);

for(int i=0;i<temp.size();i++)

{

    sum+=temp[i]-'0';

}

if(n%sum==0) cout<<"Yes"<<endl;

else cout<<"No"<<endl;

return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



int main()

{

    long long n,d,sum=0;

    cin >> n;

    d=n;

    while (n!=0)

    {

        sum+=n%10;

        n/=10;

    }



    if(d%sum==0){

        cout << "Yes" << endl;

    }

    else{

        cout << "No" << endl;

    }



    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

	ios_base::sync_with_stdio(0);

	cin.tie(0);

	int a,b ;

	cin >> b;

	int sum = 0; 

	a = b ;

	while(a)

	{

		sum = sum + a % 10;

		a /= 10 ;

	}

	if(b % sum == 0)

		cout << "Yes" << endl;

	else if(b % sum != 0)

		cout << "No"<< endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

#include<string.h>



int main()

{

	long long int n, num, sum = 0;

	scanf("%lld", &n);

	

	num = n;

	while(num != 0)

	{

		sum += num % 10;

		num /= 10;

	}

	

	if(n % sum == 0) printf("Yes\n");

	else printf("No\n");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	int n;

	while(cin>>n){

		int sum=0;

		int f=n;

		if(n>1000000000||n<1){

			break;

		}

		while(n){

			sum+=n%10;

			n/=10;

		}

		//cout<<sum<<endl;

		if(f%sum==0){

			cout<<"Yes"<<endl; 

		}

		else {

			cout<<"No"<<endl;

		}

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int n,N,m;

int main(){

	scanf("%d",&n);

	m=n;

	while(n>0){

		N+=n%10;

		n/=10;

	}

	if(m%N==0)printf("Yes");

	else printf("No");

} 

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <stdio.h>

#include <string.h>

#include <math.h>

int main()

{

	int i,j,n,s,t;

	char a[100];

	while(scanf("%s",a)!=EOF)

	{	s=t=0;

		n=strlen(a);

		for(i=0;i<n;i++)

		{

			s+=(a[i]-'0');

			t+=(a[i]-'0')*pow(10,n-i-1);

		}

		if(t%s==0)

			printf("Yes\n");

		else

			printf("No\n");

	}

	

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int n, sum;



int main() {

  scanf("%d", &n);

  int x = n;

  while (x) {

    sum += x % 10;

    x /= 10;

  }

  puts(n % sum ? "No" : "Yes");

  return 0;

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main(){

  long num;

  cin >> num;

  int sum;

  long temp=num;

  while(num){

    sum+=num%10;

    num/=10;

  }

  if(temp%sum==0){

    cout << "Yes\n";

  }

  else{

    cout << "No\n";

  }

  return 0;



}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int n, sum;



int main() {

  scanf("%d", &n);

  int x = n;

  while (x) {

    sum += x % 10;

    x /= 10;

  }

  puts(n % sum ? "No" : "Yes");

  return 0;

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define endl "\n"



using namespace std;



int main(){

    int a, temp, len, sum=0;

    cin >> a;

    len=log10(a)+1;

    temp=a;

    for(int i=0; i<len; i++){

        sum+=temp%10;

        temp/=10;

    }

    cout << (a%sum==0? "Yes":"No") << endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int n, sum;



int main() {

  scanf("%d", &n);

  int x = n;

  while (x) {

    sum += x % 10;

    x /= 10;

  }

  puts(n % sum ? "No" : "Yes");

  return 0;

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n,sum=0;





    cin>>n;

    int m=n;





    while(n!=0)

    {

        sum+=(n%10);

        n=n/10;

    }



    if(m%sum==0)

    {

        cout<<"Yes"<<endl;

    }

    else

        cout<<"No"<<endl;



    return 0;





}


// Optimized solution to the same problem (faster):
#include <cstdio>

long long n,m,k;

int main()

{

	scanf("%lld",&n),m=n;

	while(m) k+=(m%10),m/=10;

	if(n%k==0) printf("Yes");

	else printf("No");

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

bool solve(){

    int arr[100001]={0};

    int N,K;

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

    if(N==0&&K==0)return false;

    for(int i=0;i<N;i++){

        scanf("%d",&arr[i+1]);

        arr[i+1]+=arr[i];

    }

    int ma=INT_MIN;

    for(int i=0;i+K<=N;i++){

        ma=max(ma,arr[i+K]-arr[i]);

    }

    printf("%d\n",ma);

    return true;

}



int main(){

    while(solve());

}

// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;



#define int long long

typedef vector<int>vint;

typedef pair<int,int>pint;

typedef vector<pint>vpint;

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

#define reps(i,f,n) for(int i=(f);i<(n);i++)

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

#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)

#define pb push_back

#define mp make_pair

#define fi first

#define se second

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}

template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}



int N,K;

int S[101010];

signed main(){

    while(cin>>N>>K,N||K){

    rep(i,N){

        cin>>S[i+1];

        S[i+1]+=S[i];

    }



    int ma=-1001001001001001001ll;

    for(int i=0;i+K<=N;i++)chmax(ma,S[i+K]-S[i]);

    cout<<ma<<endl;

    }

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std ;



int main()

{

	int n ;

	while( cin >> n ,n )

	{

		int m ;

		cin >> m ;

		int num[ n ] ;

		for( int i  = 0 ; i < n ; i++ )

			cin >> num[ i ] ;

		int ans = 0 ;

		for( int i  = 0 ; i < n ; i++ )

		{

			int cnt = 0 ;

			for( int j = i ; j < m + i && m + i < n ; j++ )

				cnt += num[ j ] ;

			ans = max( ans ,cnt ) ;

		}

		cout << ans << endl ;

	}

	return 0 ;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



#include<algorithm>





using namespace std ;







int main()

{

	int n ,k ;



	while( 1 )

	{

		scanf( "%d %d" ,&n ,&k ) ;





		if( !( n | k ) )

		{

			return 0 ;

		}





		int if_k = k - 1 ;



		int ans = -10001 ,other[ 100000 ] ;

		

		int sum = 0 ;



		int i ;

		for( i = 0 ; i < n ; ++i )

		{

			scanf( "%d" ,&other[ i ] ) ;



			sum += other[ i ] ;





			if( i > if_k )

			{

				sum -= other[ i - k ] ;

			}



			if( i >= if_k )

			{

				ans = max( ans ,sum ) ;

			}

		}





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

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std ;



int main()

{

	int n ;

	while( cin >> n ,n )

	{

		int m ;

		cin >> m ;

		int num[ n + 1 ] ;

		num[ 0 ] = 0 ;

		for( int i = 1 ; i <= n ; i++ )

		{

			cin >> num[ i ] ;

			num[ i ] += num[ i - 1 ] ;

		}

		int ans = 0 ;

		for( int i = m ; i <= n ; i++ )

			ans = max( ans ,num[ i ] - num[ i - m ] ) ;

		cout << ans << endl ;

	}

	return 0 ;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>



#include<algorithm>





using namespace std ;







int main()

{

	int n ,k ;



	while( 1 )

	{

		scanf( "%d %d" ,&n ,&k ) ;





		if( !( n | k ) )

		{

			return 0 ;

		}





		int if_k = k - 1 ;



		int ans = -10001 ,other[ 100000 ] ;

		

		int sum = 0 ;



		int i ;

		for( i = 0 ; i < n ; ++i )

		{

			scanf( "%d" ,&other[ i ] ) ;



			sum += other[ i ] ;





			if( i > if_k )

			{

				sum -= other[ i - k ] ;

			}



			if( i >= if_k )

			{

				ans = max( ans ,sum ) ;

			}

		}





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

	}

}

// Fastest known solution for this problem: