#include <bits/stdc++.h> using namespace std; int main() { long int r ,a; while(scanf("%ld",&r)==1) { if(r<0) break; if(r==0) printf("0%\n"); else if(r==1) printf("0%\n"); else if(r>=2) { a=r*25; printf("%ld%%\n",a); } } return 0; }...
#include <bits/stdc++.h> using namespace std; int main() { long int r ,a; while(scanf("%ld",&r)==1) { if(r<0) break; if(r==0) printf("0%\n"); else if(r==1) printf("0%\n"); else if(r>=2) { a=r*25; printf("%ld%%\n",a); } } return 0; }...
#include<bits/stdc++.h> using namespace std; int main() { int i,j,k,d,sum,num,tc,n,ans,digit; while(cin>>tc) { for(k=1;k<=tc;k++) { cin>>n; num=n,ans=0; while(n>9) { while(n!=0) { digit=n%10; n/=10; ans+=digit*digit; } n=ans; ans=0; }...
#include<bits/stdc++.h> using namespace std; int main() { unsigned long long n,N; while(cin>>n and n>0) { N=(n*10)/9; if(n%9==0) { cout<<N-1<<" "<<N<<endl; } else { cout<<N<<endl; } } return 0; }...
#include <bits/stdc++.h> using namespace std; int a[10000]; int main() { int n,t,i,j; while(scanf("%d",&t)==1) { j=0; if(t==0) return 0; for(i=0;i<t;i++) { scanf("%d",&a[i]); if(a[i] > 0) { j++; a[n++]=a[i]; } } for(i=0;i<n;i++) { if(j==1)...
#include <stdio.h> int main() { int n; while((scanf("%d",&n)==1) && n!=0) { if(n>=101) printf("f91(%d) = %d\n",n,n-10); else printf("f91(%d) = 91\n",n); } return 0; }
#include<bits/stdc++.h> bool flag[1000005]; int List[1000005],primes[100000]; int listSize,cnt; using namespace std; void sieve(int n) { cnt=0; primes[cnt++] = 2; for(int i=3; i<=n; i+=2) { if(flag[i] == 0) { primes[cnt++] = i; if(i <= n/i) { for(int...
#include <stdio.h> #include <string.h> int main() { char s1[500],s2[500],s1s[500],s2s[500]; int t,i,j,k; scanf("%d ",&t); for(i=0;i<t;i++){ gets(s1); gets(s2); if(strcmp(s1,s2)==0)printf("Case %d: Yes\n",i+1); else { k=0;...
#include<bits/stdc++.h> using namespace std; int main(){ double d,v,u,t1,t2; int t; cin>>t; for(int i=0;i<t;i++){ cin>>d>>v>>u; if( u==0 || v==0 || v>=u ){ printf("Case %d: can't determine\n",i+1); continue; } t1=d/u;...
#include <stdio.h> int main() { int t,a,b,i,j=1,sum; scanf("%d",&t); while( t-- ) { sum = 0; scanf("%d %d",&a,&b); for( i=a ; i<=b ; i++) { if(i%2==1) sum += i; } printf("Case %d: %d\n",j,sum); j++; } return 0; }...
#include <bits/stdc++.h> using namespace std; int main() { double N,n; int c=1; //long int n; while(cin>>N and N!=0) { n=ceil((sqrt(8*N + 9)+ 3)/2); printf("Case %d: %.lf\n",c++,n); } return 0; }...
#include<bits/stdc++.h> using namespace std; int main() { long long int a,b,i=1; while(cin>>a>>b) { if(a==0 && b==0) break; if(a==0 || b==0) { printf("Case %lld: 0\n",i); continue ; } printf("Case %lld: %lld\n",i++,((a*b*(a-1)*(b-1))/4)); }...
#include <stdio.h> #include<iostream> #include<math.h> #define MAX 10001 using namespace std; bool flag[MAX]; int primes[MAX]; int cnt; void sieve(int n) { cnt=0; primes[cnt++] = 2; for(int i=3; i<=n; i+=2) { if(flag[i] == 0) { primes[cnt++] = i;...
#include <iostream> #include <algorithm> #include <set> #include <cmath> using namespace std; int main(void) { int tc, c, r,t,q; set<int> v; set<int>::iterator it; cin >> tc; for (t = 0; t < tc; t++) { cin >> c...
#include <bits/stdc++.h> using namespace std; int main() { char s[200],c; int i,l,j; while(gets(s)) { l=strlen(s); for(i=0;i<l;i++) { if(s[i]=='A' ||s[i]=='B' ||s[i]=='C' ) printf("2"); else if(s[i]=='D' ||s[i]=='E' ||s[i]=='F' ) printf("3"); else...
#include <bits/stdc++.h> using namespace std; char in[1002]; int main() { int j,i,count,sum,totat,digit,deg,l,q,d; bool flag; while(1) { flag=true; sum=0; l=strlen(gets(in)); if(l==1 && in[0]=='0')return 0; for(i=0;i<l;i++) sum+=in[i]-'0';...
#include <iostream> #include <string.h> using namespace std; int main() { char s[150]; int i,j,total,result,l; while(gets(s)) { total=0; l=strlen(s); for(i=0;i<l;i++) { switch(s[i]) { case 'a': total=total+1; break; case 'b': total=total+2; break; case...
#include <bits/stdc++.h> using namespace std; int main() { char input[1002]; int i,j,l,sum; while(1) { gets(input); sum=0; l=strlen(input); if(input[0]=='0' and l==1) break; for(i=0;i<l;i+=2) { sum+=input[i]-'0'; } for(i=1;i<l;i+=2) { sum-=input[i]-'0'; }...
#include <stdio.h> #include<iostream> #include<math.h> #define max 1000005 using namespace std; bool flag[max]; int primes[max]; int cnt; int sieve(int z) { int i,j; for(i=2; i<=max; i++) { primes[i]=1; } for(i=2; i<=sqrt(max); i++) { for(j=2;...
#include <bits/stdc++.h> using namespace std; int main() { long int temp,male,female,total,y; int i; while(cin>>y && y>=0) { male=0,female=1; for( i=0;i<y;i++) { temp=male; male=female+temp; female=temp+1; } cout<<male<<"...
#include <bits/stdc++.h> using namespace std; int main() { int n,m,i,j,k,l,a,b,ans; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %d",&a,&b); cout<<( (a/3) * (b/3) )<<endl; } return 0; }...
Get an early look at Python 3.14, slated for 2025! Explore expected features, performance boosts, and how it will shape Python development and data science.
The world of AI evolves at lightning speed. Discover why staying informed on the latest AI news, breakthroughs, and industry trends is essential for everyone.
Discover expert strategies and essential resources to ace the IELTS Speaking Test. Learn how to boost your fluency, vocabulary, and confidence for a top score.
Explore Python’s exciting future! Discover anticipated trends, innovations, and what upcoming releases like Python 3.13 and 3.14 mean for developers and data scientists.