Submit | All submissions | Best solutions | Back to list |
DIE4MARK - ANYTHING FOR ATTENDANCE |
Most engineering students were attending classes just because there were 5% marks for attendance. Those students were just physically present and mentally absent at the classes. So the Dean of the college suddenly announced a new system that there will be no marks for attendance. For any given student, you have to determine whether this announcement is a profit or loss for that student. You are given the percentage of marks the student got in the old system and the percentage of marks the student scored in attendance. (See explanation for test cases.)
Input
The first line consists of an integer t, the number of test cases. Then for the next t lines each test case consists of two integers a and b where ‘a’ is the percentage of marks the student got in the old system and ‘b’ is the percentage of marks the student scored in attendance.
Output
For each test case, output “profit” if the student’s mark improves in the new system or output “loss” if the student’s mark decreases because of the new system or output “same” if there’s no change.
Note: Spoj is Case Sensitive.
Constraints
1 <= t <= 100000
0 <= b <= 5
b <= a <= 100
Example
Input: 7 74 0 5 5 60 3 93 4 68 3 59 3 50 3 Output: profit loss same profit same same loss
Explanation of Example Test Cases
Case 1: The student has never attended classes. So the new system is clearly profit for the student.
Case 2: The 5 marks came only from attending classes. So the new system is clearly a loss for the student.
Case 3: The new system, ignoring the attendance will not change the mark of the student.
Case 4: Converting to the new system, the mark changes to 93.68 which the professor will round it to 94. So it’s a profit for the student.
Case 5: Converting to the new system, the mark changes to 68.42 which the professor will round it to 68. So it’s neither profit nor loss for the student.
Note: The professor will round 75.49 into 75 and 75.50 into 76.
Added by: | cegprakash |
Date: | 2012-05-10 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |