Scientific Grading
시간 제한1초메모리 제한1024 MB
과학적 표기법으로 주어진 네 학생 답을 정확한 결과와 비교해 상대 오차와 절대 오차가 모두 10^-9 미만인지 판정한다.
문제
You recently started working as a TA (teaching assistant) for your university's Scientific Computing class.
Today, Professor introduced the scientific notation, where numbers are written in the form with a real number (the significand) and an integer (the exponent).
At the end of class, she gave students the following assignment.
Given two numbers , in scientific notation, perform the following four arithmetic operations:
As a strict grader, you decided to write a program to grade students' answers.
You mark a solution correct if and only if both relative and absolute errors are less than (not including ).
If the correct answer is , then is the only acceptable answer.
Otherwise, a student's answer will be compared to the correct answer , and the relative and absolute errors are computed as and , respectively.
입력
The first line of input contains the value of , and the second line contains the value of .
The next four lines contain a student's answer to , , , and .
All numbers are in the form of <SIGNIFICAND>e<EXPONENT>. The significand starts with a sign (+ or -), followed by one digit, a period (.), and exactly nine digits.
The exponent also starts with a sign (+ or -) and is followed by an integer between and , inclusively.
The value is computed by .
The value is always represented as +0.000000000e+0, and for any nonzero values the first digit of their significand is not .
It is guaranteed that and are both nonzero.
출력
For each student solution, output Correct if it is considered correct and Incorrect otherwise. The first line of output indicates if the student's solution to is correct, the second line indicates if their solution to is correct, the third line indicates if their solution to is correct, and the fourth line indicates if their solution to is correct.