45th ICPC World Finals Challenge powered by Huawei - Problem 1


A. Parameterized Branch Instruction Stream Generation
time limit per test: 15 seconds
memory limit per test: 1024 megabytes
input: standard input
output: standard output

Examples
Input
3
17
0.42 0.18
0.58 0.16
0.50 0.41 3
Output
1
2 0 001
3 1 00010001
2 2 101101
Input
1
2
0.50 0.00
1.00 0.00
0.50 0.00 1
Output
1
1 0 01
----------------------------------------------------------------------------------------------------
