cf/mirror

Triangle Platinum?

CF
1847E2900· international gm2s256 MB⇄ interactive

Examples

Sample 1of 5
Input
3
 
63
Output
? 1 2 3
 
! -1
Sample 2of 5
Input
6
 
0
 
0
 
0
 
63
 
15
 
135
Output
? 1 2 3
 
? 2 3 4
 
? 4 5 6
 
? 1 5 6
 
? 3 5 6
 
? 1 2 4
 
! 3 2 1 4 2 2
Sample 3of 5
Input
15
 
3
 
3
 
3
 
3
 
3
 
0
Output
? 1 2 3
 
? 4 6 7
 
? 8 9 10
 
? 11 12 13
 
? 13 14 15
 
? 4 5 6
 
! -1
Sample 4of 5
Input
15
 
3
 
15
 
0
 
3
 
3
 
3
Output
? 1 2 3
 
? 3 4 5
 
? 4 5 6
 
? 7 8 9
 
? 10 11 12
 
? 13 14 15
 
! 1 1 1 2 2 4 1 1 1 1 1 1 1 1 1 1
Sample 5of 5
Input
10
 
3
 
48
 
3
 
48
 
63
 
0
Output
? 1 3 5
 
? 4 6 8
 
? 1 5 9
 
? 6 8 10
 
? 4 2 6
 
? 7 10 8
 
! 1 3 1 2 1 2 4 2 1 2
1847E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)