Post Office
Time limit1sMemory limit128 MB
Sort each item's three dimensions into length, height, and thickness, then apply the postal size rules to print one of four classes.
- Level
Easy3 of 10
- Topics
- Implementation, Math, Sorting, Simulation
- Solved
- No attempts yet
Problem
A postal service classifies mailable items (other than postcards) into three classes: letter, packet, and parcel. Every item has three dimensions — length, height, and thickness — where the length is the largest of the three and the thickness is the smallest. All measurements are in millimeters (mm).
- letter: the length is between 125 and 290, the height is between 90 and 155, and the thickness is between 0.25 and 7 (all bounds inclusive).
- packet: every dimension is at least the letter's minimum (length ≥ 125, height ≥ 90, thickness ≥ 0.25), at least one dimension exceeds the letter's maximum (length > 290, or height > 155, or thickness > 7), and in addition length ≤ 380, height ≤ 300, and thickness ≤ 50.
- parcel: every dimension is at least the letter's minimum, at least one dimension exceeds the packet's maximum (length > 380, or height > 300, or thickness > 50), and in addition the length plus the girth is at most 2100, where the girth is the perimeter of the cross-section taken perpendicular to the length, that is 2 × (height + thickness).
Any item that matches none of these three classes is not mailable.
Input
The input contains several items. Each item is given as its three dimensions (in mm), in any order, on one line. The length and the height are positive integers; the thickness is a positive integer or a positive floating-point number. The input ends with a line containing three zeros, which must not be processed.
Output
For each item, print its classification on its own line — letter, packet, parcel, or not mailable — using lowercase letters.