Timus Problem 1991 Solution #include <stdio.h> int a[10001]; int main() { int ans=0,ans1=0,k,n,i; scanf("%d %d",&n,&k); for(i=0;i<n;i++){ scanf("%d",&a[i]); } if(a[i]<=k){ ans+=k-a[i]; } else{ ans1+=a[i]-k; } printf("%d %d",ans,ans1); return 0;...
Timus Problem 2001 Solution
Timus Problem 2001 Solution #include <iostream> using namespace std; int main() { int a[3]; int b[3]; int sum,m1,m2; scanf("%d %d",a[0],b[0]); if(a[0]<0||b[0]<0||a[0]>10000||b[0]>10000) return(1); sum=a[0]+b[0]; scanf("%d %d",a[1],b[1]);...
Timus Problem 1349 Solution
#include <stdio.h> int main() { int a,b,c,n,i; for(a=1;a<=100;a++){ for(b=1;b<=100;b++){ if(b!=a){ for(c=1;c<=100;c++){ if( ( c != a && c != b)){ printf("a=%d\tb=%d\tc=%d\n",a,b,c); } }} }} return 0; }...
Timus Problem 1493 Solution
Timus Problem 1493 Solution #include <stdio.h> int main() { int a,b,i,n,sum1,sum2; sum1=0,sum2=0; for(i=0;i<6;i++){ scanf("%d",&n); sum1+=n; } sum2=sum1+1; if(sum2%2!=1){ printf("Yes"); } else{ printf("No"); } return 0; }...
Timus Problem 1639 Solution
Solution: #include <stdio.h> int main() { int m,n,sum; while(scanf("%d %d",&m,&n)!=EOF){ if(m != 1 && m==(n%m)){ printf("[:=[first]"); } else printf("[second]=:]"); } return 0; }...
Laravel – Scopes (3 Easy Steps)
Scoping is one of the superpowers that eloquent grants to developers when querying a model. Scopes allow developers to add constraints to queries for a given model. In simple terms laravel scope is just a query, a query to make the code shorter and faster. We can...
CAMBRIDGE IELTS 17 TEST 3
READING PASSAGE 1: The thylacine Q1. carnivorous keywords: Looked like a dog had series of stripes ate, diet ate an entirely 1 .......................................... diet (2nd paragraph 3rd and 4th line) 1st and 2nd paragraph, 1st paragraph,resemblance to a...
Cambridge IELTS 16 Test 4
Here we will discuss pros and cons of all the questions of the passage with step by step Solution included Tips and Strategies. Reading Passage 1 –Roman Tunnels IELTS Cambridge 16, Test 4, Academic Reading Module, Reading Passage 1 Questions 1-6. Label the diagrams...
Cambridge IELTS 16 Test 3
Reading Passage 1: Roman Shipbuilding and Navigation, Solution with Answer Key , Reading Passage 1: Roman Shipbuilding and Navigation IELTS Cambridge 16, Test 3, Academic Reading Module Cambridge IELTS 16, Test 3: Reading Passage 1 – Roman Shipbuilding and...