10573  Geometry Paradox
Moderator: Board moderators

 System administrator & Problemsetter
 Posts: 399
 Joined: Sat Jan 12, 2002 2:00 am
Mistake
Sorry! Although the problem statement says floating point, all the judge inputs are integers. I think in my defense I can say "All integers are floating point numbers" like "All alkalies are base" in chemistry days.
Edit
Hi,I want to say something first...my English is pool...
But I got A.C. and also think the problem is beautiful and clear enough...
if r1=r2,
then r1+r2=R=t/2
so R^2=t^2/4
the gray area=(t^2/4)*pi2*(t^2/16)*pi=(t^2/8)*pi
else r1!=r2
then (r1+r2)^2=(r1r2)^2+(t/2)^2
we can get 4*r1*r2=(t/2)^2
by the problem,t value must be integer,
so r1=k^2*r2(k is rational number)
if not, t will be irrational number,
so 4*k^2*r2^2=(t/2)^2
then we can got r2=t/4k,r1=tk/4
so the big circle area:
(t/4k + tk/4)^2*pi=(t^2/16k^2+t^2*k^2/16+t^2/8)*pi
the gray area still (t^2/8)*pi....
so the two pictures that post before maybe correct,
but the area of gray part maybe have precision errors,
or it will be the same.
This is my first post here,if I make a mistake,plz let me know.
Hope this will be a little help...
But I got A.C. and also think the problem is beautiful and clear enough...
if r1=r2,
then r1+r2=R=t/2
so R^2=t^2/4
the gray area=(t^2/4)*pi2*(t^2/16)*pi=(t^2/8)*pi
else r1!=r2
then (r1+r2)^2=(r1r2)^2+(t/2)^2
we can get 4*r1*r2=(t/2)^2
by the problem,t value must be integer,
so r1=k^2*r2(k is rational number)
if not, t will be irrational number,
so 4*k^2*r2^2=(t/2)^2
then we can got r2=t/4k,r1=tk/4
so the big circle area:
(t/4k + tk/4)^2*pi=(t^2/16k^2+t^2*k^2/16+t^2/8)*pi
the gray area still (t^2/8)*pi....
so the two pictures that post before maybe correct,
but the area of gray part maybe have precision errors,
or it will be the same.
This is my first post here,if I make a mistake,plz let me know.
Hope this will be a little help...

 Learning poster
 Posts: 57
 Joined: Wed Dec 10, 2003 7:32 pm
 Location: Russia, SaintPetersburg
10573  Help please
As I understand if in input "t" then write “Impossible.” else write area of grey part. Am I right???
10573WA
Please help i don't know were is an error i thing my formula is right.
[pascal]var t,i,j,k,n:longint;
r:array[1..3] of longint;
rr:real;
begin
readln(n);
for j:=1 to n do
begin
k:=0;
while not eoln do
begin
inc(k);
read(r[k]);
if k=2 then break;
end;
if j<>n then readln;
if k=2 then rr:=2*pi*r[1]*r[2]
else rr:=(pi*r[1])/8;
writeln(rr:0:4);
end;
end.[/pascal]
[pascal]var t,i,j,k,n:longint;
r:array[1..3] of longint;
rr:real;
begin
readln(n);
for j:=1 to n do
begin
k:=0;
while not eoln do
begin
inc(k);
read(r[k]);
if k=2 then break;
end;
if j<>n then readln;
if k=2 then rr:=2*pi*r[1]*r[2]
else rr:=(pi*r[1])/8;
writeln(rr:0:4);
end;
end.[/pascal]
someone who like to solve informatic problems.
http://acm.uva.es/cgibin/OnlineJudge?AuthorInfo:29650
http://acm.uva.es/cgibin/OnlineJudge?AuthorInfo:29650
10573 Help Please
I put this question in Volume CV, but did not get answer.
I put it here because I think my problem is with input. Plase help me. What is wrong with my program why I'm getting WA.
[pascal]var t,i,j,k,n:longint;
r:array[1..3] of longint;
rr:double;
begin
readln(n);
for j:=1 to n do
begin
k:=0;
while not eoln do
begin
inc(k);
read(r[k]);
if k=2 then break;
end;
if j<>n then readln;
if k=2 then rr:=2*pi*r[1]*r[2]
else rr:=(pi*r[1])/8;
writeln(rr:0:4);
end;
end. [/pascal]
I put it here because I think my problem is with input. Plase help me. What is wrong with my program why I'm getting WA.
[pascal]var t,i,j,k,n:longint;
r:array[1..3] of longint;
rr:double;
begin
readln(n);
for j:=1 to n do
begin
k:=0;
while not eoln do
begin
inc(k);
read(r[k]);
if k=2 then break;
end;
if j<>n then readln;
if k=2 then rr:=2*pi*r[1]*r[2]
else rr:=(pi*r[1])/8;
writeln(rr:0:4);
end;
end. [/pascal]
someone who like to solve informatic problems.
http://acm.uva.es/cgibin/OnlineJudge?AuthorInfo:29650
http://acm.uva.es/cgibin/OnlineJudge?AuthorInfo:29650
No. Your formula for the "one integer" case is wrong. Check that again.
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
Thank you i did not sea that write the second formula wrong.
I get AC.
I get AC.
someone who like to solve informatic problems.
http://acm.uva.es/cgibin/OnlineJudge?AuthorInfo:29650
http://acm.uva.es/cgibin/OnlineJudge?AuthorInfo:29650
10573 error in problem specifications (non integer data!!)
there have been a lot of discussions about this problem...
but, in my opinion, the clue is that in the problem's text, they say "each set contains two integer. If it contains one integer..."
but in the judge's files, there is one test with double data!!!
that's why i got a thousand times WA!
I expect they will fix this error!!!
but, in my opinion, the clue is that in the problem's text, they say "each set contains two integer. If it contains one integer..."
but in the judge's files, there is one test with double data!!!
that's why i got a thousand times WA!
I expect they will fix this error!!!
10573 Geometry Paradox ~WA
HI! I always got WA. I don't know whats wrong with it.
can anyone tell me?
can anyone tell me?
Code: Select all
#include<iostream>
#include<sstream>
#include<string>
using namespace std;
const double M_PI=3.14159265358979323846;
int main() {
int n,r1,r2,t;
string input;
cin >> n; cin.ignore();
cout.setf(ios::fixed);
cout.precision(4);
while(n) {
getline(cin,input);
if(input[1]==0  input[2]==0) {
istringstream(input) >> t;
cout << t*t*(M_PI/8.0) << endl;
}
else {
istringstream(input) >> r1 >> r2;
cout << r1*r2*(2.0*M_PI) << endl;
}
}
return 0;
}
 kbr_iut
 Experienced poster
 Posts: 103
 Joined: Tue Mar 25, 2008 11:00 pm
 Location: IUTOIC, DHAKA, BANGLADESH
 Contact:
Re: 10573  Geometry Paradox(precisition error.pliz anyone help)
code deleted.Now AC,thanx obaida
Last edited by kbr_iut on Sun May 04, 2008 8:11 am, edited 1 time in total.
It is tough to become a good programmer.
It is more tough to become a good person.
I am trying both...............................
It is more tough to become a good person.
I am trying both...............................
Re: 10573  Geometry Paradox
If only t is given, you can assume that r1 = r2, t become the diameter of the outer circle Thus the area of the outer circle becomes PI*(t/2)*(t/2) and area of the two identical inner circles become 2*PI*(t/4)*(t/4), thus the area of the gray part = (PI*t*t)/4  (PI*t*t)/8 = (PI*t*t)/8.
If there are r1 and r2, then gray part =2*PI*r1*r2.
And there is no impossible case.
If there are r1 and r2, then gray part =2*PI*r1*r2.
And there is no impossible case.
try_try_try_try_&&&_try@try.com
This may be the address of success.
This may be the address of success.