P27851 [洛谷] [NICA #1] Grades
普及-
题目描述

Problem Description

Little A has just finished his final exams and is eager to know his overall final grades.

He only has three subjects in his exams: Chinese, Mathematics, and English. Due to the school's academic policies, there are two types of assessment criteria:

  • Traditional: Pass if no more than one subject is below 60 points.
  • Special: Assign weights to each subject, where the final score of a subject is the exam score multiplied by its weight. The overall final score is the sum of the final scores of the three subjects divided by the total weight. Pass if this score is no less than 60 points.

For example, if Little A scored 70 in Chinese with a weight of 2, 50 in Mathematics with a weight of 4, and 60 in English with a weight of 3. Under the traditional criteria, he passes. However, if the special criteria are used, his overall final score is \(\dfrac{70 \times 2 + 50 \times 4 + 60 \times 3}{2 + 4 + 3} \approx 57.78\), which is a fail.

Little A has told you his scores for each subject and the weights for each subject. He wants to know if he passes under both assessment criteria.

Input Format

Input consists of one line.

First, three positive integers \(a, b, c\) are given, representing Little A's scores in Chinese, Mathematics, and English, respectively.

Next, three positive integers \(d, e, f\) are given, representing the weights for Chinese, Mathematics, and English, respectively.

Output Format

Output consists of two lines. The first line indicates whether Little A passes under the traditional assessment criteria. The second line indicates whether he passes under the special assessment criteria.

If he passes, output PASS; otherwise, output FAIL.

Sample Input and Output

Sample Input #1

70 50 60 2 4 3

Sample Output #1

PASS
FAIL

Sample Input #2

90 80 10 3 2 1

Sample Output #2

PASS
PASS

Notes

For all data, it is guaranteed that \(1 \leq a, b, c \leq 100\) and \(1 \leq d, e, f \leq 10\).

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
70 50 60 2 4 3
样例输出
PASS FAIL