#include<bits/stdc++.h>
using namespace std;
int luythua(int a, int b)
{
int total=1;
for(int i=0;i<b;i++){
total*=a;
}
return total;
}
int main()
{
int s,s1=0,s2=0,a,b,m,n;
cout<<"Nhap a,b,m,n: ";
cin>>a>>b>>m>>n;
s=luythua(a,n)+luythua(b,m);
cout<<"S=a^n+b^m="<<s<<endl;
for(int i=1;i<=n;i++){
s1+=i;
}
cout<<"S1=1+2+...+n="<<s1<<endl;
for(int i=1;i<=100;i++){
s2+=i;
}
cout<<"S2=1+2+...+100="<<s2;
//samon247
return 0;
}