-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1950A_Stair_Pear_Nither.cpp
More file actions
54 lines (47 loc) · 1.44 KB
/
1950A_Stair_Pear_Nither.cpp
File metadata and controls
54 lines (47 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* A. Stair, Peak, or Neither?
time limit per test 1 second
memory limit per test 256 megabytes
You are given three digits a, b, and c. Determine whether they form a stair, a peak, or neither.
A stair satisfies the condition a<b<c.
A peak satisfies the condition a<b>c.
Input
The first line contains a single integer t (1≤t≤1000) — the number of test cases.
The only line of each test case contains three digits a, b, c (0≤a, b, c≤9).
Output
For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).
Example
Input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
Output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR
*/
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int a, b, c;
cin >> a >> b >> c;
if (a < b && b < c)
cout << "STAIR" << endl;
else if (a < b && b > c)
cout << "PEAK" << endl;
else
cout << "NONE" << endl;
}
return 0;
}