## Mock CCC '20 Contest 1 J3 - A Geometry Problem

View as PDF

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 1G

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

koosaga is drawing a logo for the next iteration of the KAIST contest. He has gotten lazy, so he has taken a rectangle of length and height and drawn the two diagonals of the rectangle, forming four small triangles. He wishes to know the area of one of these triangles in the figure he has drawn.

#### Constraints

In tests worth 14 marks, .

#### Input Specification

The input will consist of two positive integers, and , on the first line and on the second.

#### Output Specification

Output, on a single line, the area of one of the given triangles. The area must be printed with exactly two digits after the decimal point.

#### Sample Input

2
2

#### Sample Output

1.00

• commented on May 5, 2020, 1:16 p.m.

NVM; fixed it using BigInteger

• commented on May 4, 2020, 7:05 p.m.

I seem to be constantly getting the wrong answer on the second test case in batch 2. I'm using doubles and string.format, what could be the problem?

• commented on Feb. 27, 2020, 4:08 p.m.

I don't think the intended solution uses long doubles, but I am not sure.

• commented on Feb. 27, 2020, 5:06 p.m.

No, the intended solution does not use long doubles.

• commented on Feb. 27, 2020, 10:31 a.m.

Use long doubles to have accurate rounding.