UVA Problem 109 ( SCUD Busters) Solution

UVA Problem 109 ( SCUD Busters) Solution

UVA Problem 109 ( SCUD Busters) : This problem is UVA uhunt book chapters (Computational Geometry problem) category problem. link: http://uva.onlinejudge.org/external/1/109.html   Problem Description: Find each convex hull for each area then select that...

UVA Problem 640 ( Self Numbers) Solution

UVA Problem 640 ( Self Numbers) Solution

UVA Problem 640 ( Self Numbers): Is a basic UVa problem. Details link:   Problem Details: This is a Straightforward problem.   problem solution: #include <stdio.h> #include <math.h> int d[1000010]; int generator(int num) { int sum = num;...

UVA Problem 10137 (The trip) Solution

UVA Problem 10137 (The trip) Solution

  #include <bits/stdc++.h> using namespace std; double arr[1020]; int main() { // double P=0,N=0,F,S,T; int n,i,j; while(cin>>n && n) { double avg=0; for(i=0;i<n;i++) { scanf("%lf",&arr[i]); avg += arr[i]; } avg /= n; double P = 0, N =...

UVA Problem 10221 ( Satellites) Solution

UVA Problem 10221 ( Satellites) Solution

#include<bits/stdc++.h> #define PI acos(-1) using namespace std; int main () { double dis_of_sate ,angle,r; char s[4]; while(cin>>dis_of_sate>>angle>>s) // circle (arc) length s=r*theta. (chord) length = 2*rsin(C/2) { if(s[0]=='m') angle/=60;...

UVa Problem  10347 ( Medians) Solution

UVa Problem 10347 ( Medians) Solution

  #include <bits/stdc++.h> #include <math.h> using namespace std; int main() { double a,b,c,ans,s; while(scanf("%lf %lf %lf",&a,&b,&c) == 3 ) { s=(a+b+c)/2; ans=sqrt(s*(s-a)*(s-b)*(s-c)); if(ans>0) printf("%.3lf\n",ans*(4.0/3.0)); else...

UVA Problem 10522 Solution

UVA Problem 10522 Solution

    #include <bits/stdc++.h> #include <cmath> using namespace std; int main() { int tc; cin>>tc; while (tc) { double ha, hb, hc,a,b,c;//s,s1,a1,b1,c1,a,b,c; scanf("%lf%lf%lf", &ha, &hb, &hc); a=1/ha,b=1/hb,c=1/hc; double s1=(a +...

UVA Problem 10573 Solution

UVA Problem 10573 Solution

    #include <bits/stdc++.h> #define PI 2*acos(0) using namespace std; int main() { int n,tc,i,j; char t[2]; cin>>tc; while(tc--) { int a,b; cin>>a; if(getchar()=='\n') { printf("%.4lf\n", (2*a*a*PI)/16); } else { cin>>b;...

UVA Problem 10589 (Area) Solution

UVA Problem 10589 (Area) Solution

    #include <bits/stdc++.h> using namespace std; int main() { int N,a,M,rr; double x,y; while(scanf("%d %d",&N,&a)!=EOF && N) { bool f = true; M = 0; rr = a*a; for(int i = 0;i<N;++i) { scanf("%lf %lf",&x,&y); f = true;...

UVA Problem 10991(Region) Solution

UVA Problem 10991(Region) Solution

    #include<bits/stdc++.h> #include <iostream> #include<math.h> using namespace std; int main() { double c1,c2,c3,a,b,c,s,ang1,ang2,ang3,arc1,arc2,arc3,area,area1,area2; int tc; scanf("%d",&tc); while(tc--){...

UVA Problem 10341 – Solve It  Solution

UVA Problem 10341 – Solve It Solution

#include <cstdio> #include <cmath> using namespace std; int main() { int T,p,q,r,s,t,u; double lo,hi,mi,f; while(scanf("%d %d %d %d %d %d",&p,&q,&r,&s,&t,&u)==6) { if(p*exp(-1)+q*sin(1)+r*cos(1)+s*tan(1)+t+u>1e-9 || p+r+u<0) {...

UVA Problem Uva 369 – Combinations Solution

UVA Problem Uva 369 – Combinations Solution

    #include <bits/stdc++.h> using namespace std; long double func_tion (long double n) { long double i,r = 1; for ( i = 2; i <= n; i++) { r *= i; } return r; } int main () { long double M, N,r,n,m; while (cin>>N>>M) { if( N==0 and M==0...

UVA Problem 621 ( Secret Research ) Solution

UVA Problem 621 ( Secret Research ) Solution

    #include <bits/stdc++.h> using namespace std; int main() { int tc; char s[2000],l; cin>>tc; while (tc--) { scanf("%s", s); l = strlen(s); if (strcmp(s, "1") == 0 || strcmp(s, "4") == 0 || strcmp(s, "78") == 0) printf("+\n"); else if ( s[l -...

UVA Problem 846 Steps Solution

UVA Problem 846 Steps Solution

#include<bits/stdc++.h> using namespace std; int main() { double n; int cases; int cont=0; while(cin>>n){ cont=0; for(cases=1;;) { if((cases%2)==1) { n/=9; cont++; } else { n/=2; cont++; } if(n<=1) { break; } cases++; } if(cont%2==1) printf("Stan...

UVA Problem 945 Bicoloring  Solution

UVA Problem 945 Bicoloring Solution

    #include<stdio.h> #include<string.h> int main() { int l,i,j,count=0; char s[100000]; while(gets(s)) { l=strlen(s); for(i=0;i<l;i++) { switch(s[i]) { case 'b': { for(j=0;j<count;j++) printf(" "); count=0; break; } case '1':...

Cambridge IELTS 16 Test 1

Cambridge IELTS 16 Test 1

Cambridge IELTS 16, Test 1, Reading Passage 1: Why We Need to Protect Bolar Bears, Solution with Answer Key Cambridge IELTS 16, Test 1: Reading Passage 1 – Why We Need to Protect Bolar Bears with Answer Key. Here we will discuss pros and cons of...

Cambridge IELTS 15 Reading Test 4 Answers

Cambridge IELTS 15 Reading Test 4 Answers

PASSAGE 1: THE RETURN OF THE HUARANGO QUESTIONS 1-5: COMPLETE THE NOTES BELOW. 1. Answer: water Key words:  access, deep, surface Paragraph 2 provides information on the role of the huarango tree: “it could reach deep water sources”. So...

Cambridge IELTS 15 Reading Test 2 Answers 

Cambridge IELTS 15 Reading Test 2 Answers 

PASSAGE 1: COULD URBAN ENGINEERS LEARN FROM DANCE ?  QUESTIONS 1- 6: READING PASSAGE 1 HAS SEVEN PARAGRAPHS, A-G. 1. Answer: B Key words: way of using dance, not proposing By using the skimming and scanning technique, we would find that before...

Cambridge IELTS 15 Reading Test 1 Answers

Cambridge IELTS 15 Reading Test 1 Answers

PASSAGE 1: NUTMEG – A VALUABLE SPICE QUESTIONS 1- 4: COMPLETE THE NOTES BELOW.CHOOSE ONE WORD ONLY FROM THE PASSAGE FOR EACH ANSWER.WRITE YOUR ANSWER IN BOXES 1-8 ON YOUR ANSWER SHEET. 1. Answer: oval Key words: leaves, shape Using the scanning skill,...