4-masala #include using namespace std;
int main()
{
long long a , b;
cin >> a >> b ;
cout << a*b;
return 0;
}
5-masala
#include #include using namespace std;
int main()
{
long long z, n, c=0, res;
cin >> z;
if(z==0) return puts("-1"), 0;
n=z>0 ? z : -z;
for (int i=1; 1LL * i * i<=n; i++)
{
if(n%i==0)
{
c++;
if(i*i!=n)c++;
}
}
if(c%2==1 && z>0) res=c+1;
else{
res =c;
}
cout << res;
return 0;
}
6-masala #include using namespace std;
int main()
{
int n,k;
cin>>n;
k=log(n)/log(10)+1;
if(n%400==0||n%4==0&&n%100!=0)
{
if(k==1){cout << "12/09/000"<< n ;}
if(k==2){cout << "12/09/00"<< n ;}
if(k==3){cout << "12/09/0"<< n ;}
if(k==4){cout << "12/09/"<< n ;}
}
else{
if(k==1){cout << "13/09/000"<< n ;}
if(k==2){cout << "13/09/00"<< n ;}
if(k==3){cout << "13/09/0"<< n ;}
if(k==4){cout << "13/09/"<< n ;}
}
return 0;
}
7-masala #include using namespace std;
int main()
{
long long n,k;
cin>>n;
long long f[46]={0,1};
for (int i=2; i<=45; i++)
{
f[i]=f[i-2]+f[i-1];
}
cout << f[n]*2;
return 0;
}
8-masala #include using namespace std;
int main()
{
long long a,b,c,d,e,mn,mx;
cin>>a>>b>>c>>d>>e;
mn=min(min(a,b),min(c,min(e,d)));
mx=max(max(a,b),max(c,max(e,d)));
cout< return 0;
}
9-masala #include using namespace std;
int main(){
int n, m;
cin >> n;
int arr[105];
for (int i = 0; i < n; i++){
cin >> arr[i];
}
for (int i = 0; i < n; i++){
for (int j = 0; j < n - i - 1; j++){
if (arr[j] > arr[j + 1]){
m = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = m;
}
}
}
for (int i = 0; i < n; i = i + 2){
if (arr[i] != arr[i + 1]){
cout << arr[i];
return 0;
break;
}
}
cout << arr[n - 1];
return 0;
}
10-masala #include using namespace std;
int main()
{
long long A,B,C,N,d;
cin >> N;
cin >> A >> B >> C;
d=A+B+C;
if(N<=d)
{
cout << "Yes";
}
else
{
cout << "No";
}
return 0;
}
11-masala #include using namespace std;
int main()
{
int n;
cin>>n;
long long a[100];
for (int i=0; i{
cin>>a[i];
}
sort(a,a+n);
cout << a[n-2];
return 0;
}
12-masala #include #include using namespace std;
int main(){
long long int n, soniTub = 1;
cin >> n;
bool ha = true;
for (int j = 3; j <= n; j += 2){
ha = true;
for (int i = 2; i <= sqrt(j); i++)
{
if (j % i == 0)
{
ha = false;
break;
}
}
if (ha)
soniTub++;
}
if (soniTub % 2 != 0)
cout << "Ali";
else
cout << "Bobur";
}
13-masala
#include using namespace std;
int main(){
long long n, k;
cin>>n>>k;
if(n==0) cout<<"1";
else
cout<}
14-masala #include #include #define qol 1000000007
int binpow(int a,int n){
if(n==0) return 1;
if(n%2==0){
int x=binpow(a,n/2);
return 1LL*x*x%qol;}
return 1LL*a*binpow(a,n-1)%qol;
}
using namespace std;
int main(){
int n,k;
cin>>n>>k;
cout<}
15-masala #include using namespace std;
const int mod = 1e9 + 7;
int binpow(int a, int n ){
if(n == 0) return 1;
if(n % 2 == 0){
int x = binpow(a, n/2);
return 1LL * x * x % mod;
}
return 1LL*a*binpow(a, n-1) % mod;
}
int main(){
int n, k, a, b;
cin >> n >> k;
a = binpow(k, n) - 1;
b = k - 1;
cout << 1LL * a * binpow(b, mod - 2) % mod;
return 0;
}
string son(ll n){
string satr;
switch(n){
case 1: return("bir");
case 2: return("ikki");
case 3: return("uch");
case 4: return("to'rt");
case 5: return("besh");
case 6: return("olti");
case 7: return("yetti");
case 8: return("sakkiz");
case 9: return("to'qqiz");
case 10: return("o'n");
case 20: return("yigirma");
case 30: return("o'ttiz");
case 40: return("qirq");
case 50: return("ellik");
case 60: return("oltmish");
case 70: return("yetmish");
case 80: return("sakson");
case 90: return("to'qson");
case 100: return("yuz");
case 1000: return("ming");
case 1000000: return("million");
case 1000000000: return("milliard");
default: return("");
}
}
22-masala #include using namespace std;
int main()
{
long long N,b;
cin >> N ;
b=(N%100)/10;
cout << b;
return 0;
}
23-masala
#include
using namespace std;
int main()
{
long long N,b;
cin >> N ;
b=N%10;
cout << b;
return 0;
}
24-masala #include
using namespace std;
int main ()
{
long long h,m,s,H,M,S,a,b;
cin>>h>>m>>s>>H>>M>>S;
a=h*3600+m*60+s;
b=H*3600+M*60+S;
cout << b-a;
return 0;
}
25-masala #include #include #include using namespace std;
int main () {
string n;
cin >>n;
int q=0,k=86400;
for (char c:n)
q=(q*10+(c-48))%k;
int h,m,s;
h=q/3600;
q%=3600;
m=q/60;
s=q%60;
printf("%d:%02d:%02d",h,m,s);
return 0;
}
26-masala #include using namespace std;
int main () {
int t;
cin >>t;
long long n,q,mod=1e9+7;
for (int i=0;icin >>n;
q=n%mod;
cout<}
return 0;
}
27-masala #include
using namespace std;
int main()
{
int n,m;
int t;
cin>>t;
while(t--){
cin>>n>>m;
int b=0, k=n-1;
for(int i=0;i//cout<if(k==m||b==m){
cout<}
if(i%2==0)
k--;
else
b++;
}
}
return 0;
}
28-masala #include using namespace std;
int main(){
int n , ax, ay , bx, by;
cin >> n;
for(int i = 0; i < n; i++)
{
cin >> ax >> ay >> bx >> by;
cout << 2 * bx - ax <<' '<< 2 * by - ay << endl;
}
return 0;
}
28-masala #include using namespace std;
long long divisorsSame(long long n)
{
long long even_div = 0, odd_div = 0;
for (long long i = 1; i <= sqrt(n); i++) {
if (n % i == 0) {
if (n / i == i) {
if (i % 2 == 0) {
even_div++;
}
else {
odd_div++;
}
}
else {
if (i % 2 == 0) {
even_div++;
}
else {
odd_div++;
}
if (n / i % 2 == 0) {
even_div++;
}
else {
odd_div++;
}
}
}
}
return even_div;
}
int main()
{
long long N,n;
cin >>n;
for(long long i=0;icin >>N;
cout << divisorsSame(N)<}
return 0;
}
29-masala #include using namespace std;
long long divisorsSame(long long n)
{
long long even_div = 0, odd_div = 0;
for (long long i = 1; i <= sqrt(n); i++) {
if (n % i == 0) {
if (n / i == i) {
if (i % 2 == 0) {
even_div++;
}
else {
odd_div++;
}
}
else {
if (i % 2 == 0) {
even_div++;
}
else {
odd_div++;
}
if (n / i % 2 == 0) {
even_div++;
}
else {
odd_div++;
}
}
}
}
return even_div;
}
int main()
{
long long N,n;
cin >>n;
for(long long i=0;icin >>N;
cout << divisorsSame(N)<}
return 0;
}