DIE4MARK - ANYTHING FOR ATTENDANCE
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)
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.
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
Explanation of testcases:
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.