stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.325541960416701x):
#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");

}
// Slower C++ solution:
/*

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;

  

}

// Faster C++ solution for the same problem (measured speedup: 5.256031609319794x):
#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");

}
// Slower C++ solution:
#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;

}




// Faster C++ solution for the same problem (measured speedup: 5.322447602656401x):
#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");

}
// Slower C++ solution:
#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;



}


// Faster C++ solution for the same problem (measured speedup: 5.360430732211921x):
#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");

}
// Slower C++ solution:
#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;

}




// Faster C++ solution for the same problem (measured speedup: 5.31220323347698x):
#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");

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.308771526534901x):
#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");

}
// Slower C++ solution:
#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";

}  

// Faster C++ solution for the same problem (measured speedup: 5.30997911719003x):
#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");

}
// Slower C++ solution:
#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;

      

 }       


// Faster C++ solution for the same problem (measured speedup: 5.466673334039876x):
#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");

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.329433417571115x):
#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");

}
// Slower C++ solution:
/* *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();

}


// Faster C++ solution for the same problem (measured speedup: 5.39298791364458x):
#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");

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.317938169567223x):
#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");

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.321780367770316x):
#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");

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.3681658802649235x):
#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");

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.322449095351896x):
#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");

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.398784050250101x):
#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");

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.317412148190524x):
#include <stdio.h>

#include <string.h>

int main()

{

	long int s=0,x,y;

	scanf("%ld",&x);

	y=x;

	while(x!=0)

	{

		s=s+x%10;

		x=x/10;

	}

	if(y%s==0)

	printf("Yes");

	else printf("No");

	return 0;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.321534640179865x):
#include<stdio.h>

int main()

{

	long long n,m;

	int s;

	s=0;

	scanf("%lld",&n);

	m=n;

	while(n)

	{

		s+=n%10;

		n=n/10;

	}

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

	else printf("No\n");

	return 0;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.325735047262364x):
#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");

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.089506817747636x):
#include<stdio.h>

#include<math.h>

#include<string.h>

int max(int a,int b){

   if(a>b) return a;

   return b;

}

int min(int a,int b){

   if(a<b) return a;

   return b;

}

void sort(char *a,int l){

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

       for(int j=i+1;j<l;j++){

          char t;

         if(a[i]>a[j]) {

            t=a[i];

            a[i]=a[j];

            a[j]=t;

         }



       }

    }





}

typedef long long int lli;

lli s(lli a){

   for(lli sm=0;a;){

      sm+=a%10;

      a/=10;

      if(a==0) return sm;

   }

}

int main(){

  // printf("%lld ",100%s(100));

      lli a,b[1000];

    scanf("%lld",&a);

   if(a%s(a)){

     printf("No");

   }

   else printf("Yes");



}
// Slower C++ solution:
#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;



}


// Faster C++ solution for the same problem (measured speedup: 5.307332959212914x):
#include<stdio.h>

#include<math.h>

#include<string.h>

int max(int a,int b){

   if(a>b) return a;

   return b;

}

int min(int a,int b){

   if(a<b) return a;

   return b;

}

void sort(char *a,int l){

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

       for(int j=i+1;j<l;j++){

          char t;

         if(a[i]>a[j]) {

            t=a[i];

            a[i]=a[j];

            a[j]=t;

         }



       }

    }





}

typedef long long int lli;

lli s(lli a){

   for(lli sm=0;a;){

      sm+=a%10;

      a/=10;

      if(a==0) return sm;

   }

}

int main(){

  // printf("%lld ",100%s(100));

      lli a,b[1000];

    scanf("%lld",&a);

   if(a%s(a)){

     printf("No");

   }

   else printf("Yes");



}
// Slower C++ solution:
#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;



}


// Faster C++ solution for the same problem (measured speedup: 5.29711846127262x):
#include<stdio.h>

#include<math.h>





int main()

{

	long int n, a, b, c=0;

	scanf("%ld", &n);

	a=n;

	while(a){

		b=a%10;

		c+=b;

		a=a/10;

	}

	

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

	

	else printf("No\n");

	return 0;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.308000202589572x):
#include<stdio.h>

#include<math.h>





int main()

{

	long int n, a, b, c=0;

	scanf("%ld", &n);

	a=n;

	while(a){

		b=a%10;

		c+=b;

		a=a/10;

	}

	

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

	

	else printf("No\n");

	return 0;

}
// Slower C++ solution:
#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;



}


// Faster C++ solution for the same problem (measured speedup: 5.2937670175501275x):
#include<stdio.h>

int sun(int n)

{

    int a, sum;

    sum = n%10;

    while(n>0)

    {

        n=n/10;

        sum = sum + (n%10);

    }

    return sum;

}

int main()

{

    int n, sn;

    scanf("%d", &n);

    sn = sun(n);

    //printf("%d\n", sn);

    if(n%sn==0)

    {

        printf("Yes\n");

    }

    else

    {

        printf("No\n");

    }

    return 0;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.304641874077944x):
#include<stdio.h>

int sun(int n)

{

    int a, sum;

    sum = n%10;

    while(n>0)

    {

        n=n/10;

        sum = sum + (n%10);

    }

    return sum;

}

int main()

{

    int n, sn;

    scanf("%d", &n);

    sn = sun(n);

    //printf("%d\n", sn);

    if(n%sn==0)

    {

        printf("Yes\n");

    }

    else

    {

        printf("No\n");

    }

    return 0;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.0895393405333764x):
#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;

}
// Slower C++ solution:
#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;



}


// Faster C++ solution for the same problem (measured speedup: 5.307491388008287x):
#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;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.31839443817575x):
#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;

}
// Slower C++ solution:
#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;





}


// Faster C++ solution for the same problem (measured speedup: 5.3220633743000745x):
#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");

}
// Slower C++ solution:
#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());

}

// Faster C++ solution for the same problem (measured speedup: 1.4348560293446513x):
#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;

}
// Slower C++ solution:
#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 ;

}

// Faster C++ solution for the same problem (measured speedup: 5.021857242941657x):
#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 ) ;

	}

}