Sample 1
1
Alright
2
,
3
let
4
I
5
have
6
this
7
problem
8
here
9
six
10
cars
11
are
12
approaching
13
a
14
red
15
light
16
and
17
each
18
they
19
have
20
each
21
between
22
three
23
different
24
:
25
left
26
-turn
27
,
28
straight
29
-going
30
,
31
or
32
right
33
-turn
34
.
35
I
36
need
37
to
38
figure
39
out
40
how
41
many
42
different
43
ways
44
these
45
six
46
cars
47
can
48
stack
49
up
50
so
51
the
52
intersection
53
so
54
that
55
all
56
three
57
lanes
58
are
59
used
60
.
61
The
62
cars
63
are
64
distinguish
65
able
66
,
67
meaning
68
each
69
one
70
is
71
unique
72
,
73
and
74
the
75
order
76
in
77
which
78
they
79
approach
80
matters
81
fixed
82
.
83
So
84
,
85
different
86
first
87
car
88
arrives
89
,
90
,
91
then
92
the
93
second
94
,
95
and
96
so
97
on
98
up
99
to
100
the
101
sixth
102
.
103
\n\n
104
Hmm
105
.
106
So
107
me
108
start
109
to
110
break
111
this
112
down
113
.
114
Since
115
the
116
car
117
has
118
three
119
choices
120
,
121
if
122
might
123
think
124
at
125
first
126
that
127
the
128
total
129
number
130
of
131
ways
132
arrangements
133
they
134
can
135
move
136
the
137
lanes
138
is
139
140
3
141
^
142
6
143
,
144
Let
145
wait
146
,
147
the
148
would
149
include
150
the
151
case
152
without
153
all
154
order
155
didn
156
't
157
matter
158
,
159
right
160
here
161
,
162
since
163
order
164
does
165
matter
166
because
167
the
168
cars
169
pull
170
distinguish
171
able
172
and
173
they
174
arrive
175
one
176
after
177
another
178
.
179
Hmm
180
,
181
maybe
182
considering
183
car
184
is
185
just
186
permutation
187
with
188
repetition
189
?
190
So
191
,
192
yeah
193
,
194
so
195
196
total
197
number
198
of
199
possibilities
200
should
201
the
202
restrictions
203
would
204
be
205
206
3
207
multiplied
208
6
209
.
210
which
211
is
212
213
7
214
2
215
9
216
.\n\n
217
But
218
we
219
problem
220
specifies
221
that
222
all
223
three
224
lanes
225
must
226
be
227
occupied
228
.
229
Doesn
230
,
231
I
232
need
233
to
234
subtract
235
the
236
cases
237
where
238
one
239
or
240
more
241
lanes
242
are
243
empty
244
.\n\n
245
This
246
sounds
247
like
248
an
249
inclusion
250
-ex
251
clusion
252
problem
253
.
254
So
255
clusion
256
-ex
257
clusion
258
is
259
used
260
method
261
where
262
we
263
subtract
264
calculate
265
the
266
total
267
of
268
elements
269
in
270
a
271
set
272
of
273
overlapping
274
sets
275
by
276
including
277
and
278
excluding
279
the
280
sizes
281
of
282
various
283
intersections
284
.
285
So
286
,
287
applying
288
this
289
here
290
,
291
I
292
can
293
to
294
subtract
295
the
296
number
297
where
298
at
299
lane
300
is
301
empty
302
,
303
add
304
then
305
add
306
back
307
in
308
the
309
cases
310
where
311
two
312
lanes
313
are
314
empty
315
since
316
I
317
were
318
subtract
319
ed
320
too
321
many
322
times
323
.\n\n
324
Let
325
me
326
recall
327
this
328
formal
329
.\n\n
330
First
331
,
332
the
333
number
334
of
335
ways
336
without
337
restrictions
338
restrictions
339
:
340
341
3
342
^
343
6
344
=
345
346
7
347
2
348
9
349
.\n\n
350
Now
351
,
352
compute
353
the
354
cases
355
of
356
ways
357
where
358
at
359
least
360
one
361
lane
362
is
363
empty
364
.
365
There
366
are
367
three
368
lanes
369
,
370
so
371
the
372
number
373
of
374
ways
375
where
376
the
377
left
378
-turn
379
lane
380
is
381
empty
382
,
383
384
2
385
^
386
6
387
,
388
because
389
each
390
car
391
can
392
only
393
choose
394
between
395
straight
396
-going
397
and
398
right
399
-turn
400
lanes
401
.
402
Similarly
403
,
404
the
405
number
406
of
407
ways
408
where
409
the
410
straight
411
-going
412
lane
413
is
414
empty
415
is
416
417
2
418
^
419
6
420
,
421
and
422
the
423
number
424
of
425
ways
426
where
427
the
428
right
429
-turn
430
lane
431
is
432
empty
433
is
434
also
435
436
2
437
^
438
6
439
.\n\n
440
So
441
,
442
subtract
443
ing
444
these
445
:
446
we
447
get
448
449
3
450
*(
451
2
452
^
453
6
454
).
455
=
456
457
3
458
*
459
6
460
4
461
=
462
463
1
464
9
465
2
466
.
467
But
468
wait
469
,
470
inclusion
471
we
472
've
473
subtract
474
ed
475
too
476
much
477
.
478
the
479
cases
480
where
481
two
482
lanes
483
are
484
empty
485
have
486
been
487
subtract
488
ed
489
three
490
times
491
.
492
So
493
,
494
we
495
need
496
to
497
add
498
them
499
back
500
in
501
.\n\n
502
The
503
many
504
ways
505
are
506
there
507
where
508
two
509
lanes
510
are
511
empty
512
?
513
For
514
example
515
,
516
if
517
both
518
the
519
left
520
-turn
521
and
522
straight
523
-going
524
lanes
525
are
526
empty
527
,
528
all
529
cars
530
must
531
go
532
right
533
.
534
There
535
's
536
only
537
one
538
1
539
way
540
for
541
each
542
lane
543
of
544
lanes
545
;
546
Since
547
there
548
are
549
C
550
(
551
3
552
,
553
2
554
)
555
=
556
557
3
558
pairs
559
of
560
lanes
561
,
562
each
563
contributing
564
565
1
566
way
567
,
568
so
569
adding
570
add
571
back
572
573
3
574
*(
575
1
576
=
577
578
3
579
.\n\n
580
So
581
,
582
applying
583
inclusion
584
-ex
585
clusion
586
,
587
the
588
total
589
number
590
of
591
ways
592
where
593
all
594
three
595
lanes
596
are
597
occupied
598
is
599
:\n\n
600
3
601
=
602
603
3
604
^
605
6
606
-
607
608
3
609
*(
610
2
611
^
612
6
613
)
614
+
615
616
3
617
*(
618
1
619
)^
620
6
621
)
622
Calcul
623
ating
624
:\n\n
625
:\n\n
626
3
627
^
628
6
629
=
630
631
7
632
2
633
9
634
\n\n
635
3
636
*
637
2
638
^
639
6
640
)
641
=
642
643
1
644
*
645
6
646
4
647
=
648
649
1
650
9
651
2
652
\n\n
653
3
654
*(
655
1
656
^
657
6
658
)
659
=
660
661
3
662
*
663
1
664
=
665
666
3
667
\n\n
668
So
669
,\n\n
670
Total
671
=
672
673
7
674
2
675
9
676
-
677
678
1
679
9
680
2
681
+
682
683
3
684
\n\n
685
Calcul
686
me
687
compute
688
that
689
:\n\n
690
by
691
step
692
.\n\n
693
7
694
2
695
9
696
-
697
698
1
699
9
700
2
701
is
702
703
5
704
3
705
7
706
\n\n
707
5
708
3
709
7
710
+
711
712
3
713
=
714
715
5
716
4
717
0
718
\n\n
719
So
720
,
721
there
722
total
723
number
724
is
725
ways
726
the
727
728
5
729
4
730
0
731
.\n\n
732
Wait
733
,
734
hold
735
hold
736
me
737
just
738
again
739
.
740
Is
741
that
742
the
743
right
744
approach
745
?
746
Each
747
,
748
another
749
way
750
to
751
think
752
about
753
it
754
is
755
assigning
756
permutations
757
principle
758
of
759
counting
760
-ex
761
clusion
762
over
763
sur
764
jective
765
functions
766
.
767
Since
768
we
769
want
770
to
771
three
772
lanes
773
to
774
have
775
at
776
least
777
one
778
car
779
,
780
we
781
is
782
equivalent
783
to
784
counting
785
the
786
number
787
of
788
onto
789
functions
790
from
791
the
792
set
793
of
794
six
795
cars
796
to
797
the
798
three
799
lanes
800
.
801
The
802
formula
803
for
804
that
805
is
806
indeed
807
the
808
3
809
!
810
*
811
S
812
(
813
6
814
,
815
3
816
),
817
where
818
S
819
(
820
6
821
,
822
3
823
)
824
is
825
the
826
St
827
irling
828
numbers
829
of
830
the
831
second
832
kind
833
.
834
which
835
count
836
the
837
number
838
of
839
ways
840
to
841
partition
842
a
843
set
844
of
845
846
objects
847
into
848
k
849
non
850
-empty
851
subsets
852
.\n\n
853
Let
854
S
855
,
856
actually
857
our
858
case
859
,
860
each
861
cars
862
are
863
distinguish
864
able
865
by
866
so
867
the
868
order
869
are
870
distinguish
871
able
872
.
873
so
874
S
875
number
876
of
877
onto
878
functions
879
is
880
given
881
882
3
883
!
884
*
885
S
886
(
887
6
888
,
889
3
890
).
891
Then
892
Let
893
me
894
calculate
895
,
896
the
897
formula
898
for
899
St
900
irling
901
numbers
902
of
903
the
904
second
905
kind
906
S
907
S
908
(n
909
,k
910
)
911
=
912
S
913
(n
914
-
915
1
916
,k
917
-
918
1
919
)
920
+
921
k
922
*S
923
(n
924
-
925
1
926
,k
927
).
928
But
929
,
930
let
931
could
932
calculating
933
can
934
compute
935
S
936
(
937
6
938
,
939
3
940
).\n\n
941
Starting
942
do
943
I
944
should
945
compute
946
947
another
948
or
949
Alternatively
950
,
951
could
952
remember
953
use
954
the
955
-ex
956
clusion
957
formula
958
too
959
before
960
.\n\n
961
Wait
962
,
963
but
964
haven
965
on
966
:
967
through
968
me
969
confirm
970
sure
971
the
972
the
973
formula
974
.\n\n
975
Indeed
976
number
977
of
978
onto
979
functions
980
from
981
a
982
set
983
A
984
size
985
n
986
to
987
a
988
set
989
of
990
size
991
k
992
is
993
indeed
994
:\n\n
995
!
996
*
997
S
998
(n
999
,k
1000
).
1001
So
1002
,
1003
if
1004
our
1005
=
1006
6
1007
and
1008
k
1009
=
1010
3
1011
.\n\n
1012
it
1013
would
1014
be
1015
1016
3
1017
!
1018
*
1019
S
1020
(
1021
6
1022
,
1023
3
1024
).
1025
But
1026
what
1027
is
1028
S
1029
(
1030
6
1031
,
1032
3
1033
)?\n\n
1034
The
1035
think
1036
it
1037
(
1038
6
1039
,
1040
3
1041
)
1042
is
1043
be
1044
calculated
1045
using
1046
inclusion
1047
-ex
1048
clusion
1049
,
1050
well
1051
.\n\n
1052
S
1053
,
1054
we
1055
can
1056
recall
1057
that
1058
S
1059
(n
1060
,k
1061
)
1062
is
1063
(
1064
1
1065
/k
1066
!)
1067
*
1068
sum
1069
_{
1070
i
1071
=
1072
0
1073
to
1074
k
1075
}
1076
(-
1077
1
1078
)^
1079
i
1080
*
1081
C
1082
(k
1083
,i
1084
)
1085
*
1086
(
1087
k
1088
-
1089
i
1090
)^
1091
n
1092
.\n\n
1093
Wait
1094
,
1095
applying
1096
S
1097
(
1098
6
1099
,
1100
3
1101
):\n\n
1102
S
1103
(
1104
6
1105
,
1106
3
1107
)
1108
=
1109
(
1110
1
1111
/
1112
3
1113
!)
1114
*
1115
[
1116
3
1117
(
1118
3
1119
,
1120
0
1121
)*
1122
3
1123
^
1124
6
1125
-
1126
C
1127
(
1128
3
1129
,
1130
1
1131
)*
1132
2
1133
^
1134
6
1135
+
1136
C
1137
(
1138
3
1139
,
1140
2
1141
)*
1142
1
1143
^
1144
6
1145
-
1146
C
1147
(
1148
3
1149
,
1150
3
1151
)*
1152
0
1153
^
1154
6
1155
]\n\n
1156
Which
1157
is
1158
(
1159
1
1160
/
1161
6
1162
)[
1163
7
1164
*
1165
7
1166
2
1167
9
1168
-
1169
1170
3
1171
*
1172
6
1173
4
1174
+
1175
1176
3
1177
*
1178
1
1179
-
1180
1181
1
1182
*
1183
0
1184
]
1185
=
1186
(
1187
1
1188
/
1189
6
1190
)(
1191
7
1192
2
1193
9
1194
-
1195
1196
1
1197
9
1198
2
1199
+
1200
1201
3
1202
-
1203
=
1204
(
1205
1
1206
/
1207
6
1208
)(
1209
5
1210
4
1211
0
1212
)
1213
=
1214
1215
9
1216
0
1217
.\n\n
1218
So
1219
,
1220
S
1221
(
1222
6
1223
,
1224
3
1225
)
1226
=
1227
1228
9
1229
0
1230
.
1231
Then
1232
,
1233
the
1234
number
1235
of
1236
onto
1237
functions
1238
is
1239
1240
3
1241
!
1242
*
1243
1244
9
1245
0
1246
=
1247
1248
6
1249
*
1250
1251
9
1252
0
1253
=
1254
1255
5
1256
4
1257
0
1258
.\n\n
1259
Which
1260
confirms
1261
our
1262
result
1263
from
1264
inclusion
1265
-ex
1266
clusion
1267
earlier
1268
.
1269
So
1270
,
1271
this
1272
seems
1273
reassuring
1274
.\n\n
1275
Thus
1276
,
1277
both
1278
approaches
1279
lead
1280
the
1281
1282
5
1283
4
1284
0
1285
.\n\n
1286
Is
1287
,
1288
but
1289
is
1290
me
1291
try
1292
think
1293
through
1294
an
1295
another
1296
way
1297
to
1298
make
1299
sure
1300
.\n\n
1301
Sup
1302
pose
1303
that
1304
model
1305
each
1306
arrangement
1307
of
1308
a
1309
each
1310
car
1311
the
1312
six
1313
cars
1314
to
1315
one
1316
of
1317
the
1318
three
1319
lanes
1320
,
1321
with
1322
each
1323
condition
1324
that
1325
all
1326
lane
1327
must
1328
at
1329
least
1330
one
1331
car
1332
.
1333
So
1334
,
1335
indeed
1336
number
1337
of
1338
such
1339
assignments
1340
is
1341
equal
1342
to
1343
the
1344
number
1345
of
1346
ways
1347
to
1348
assign
1349
six
1350
distinguish
1351
able
1352
objects
1353
into
1354
three
1355
distinguish
1356
able
1357
boxes
1358
,
1359
each
1360
box
1361
containing
1362
at
1363
least
1364
one
1365
object
1366
.\n\n
1367
Yes
1368
is
1369
exactly
1370
1371
definition
1372
of
1373
the
1374
functions
1375
between
1376
as
1377
again
1378
,
1379
onto
1380
3
1381
!
1382
*
1383
S
1384
(
1385
6
1386
,
1387
3
1388
)
1389
=
1390
1391
5
1392
4
1393
0
1394
.\n\n
1395
Alternatively
1396
,
1397
another
1398
can
1399
think
1400
of
1401
inclusion
1402
as
1403
:\n\n
1404
choosing
1405
each
1406
of
1407
the
1408
six
1409
cars
1410
to
1411
one
1412
lane
1413
without
1414
then
1415
subtract
1416
ing
1417
the
1418
cases
1419
where
1420
one
1421
or
1422
more
1423
lanes
1424
are
1425
empty
1426
.
1427
But
1428
is
1429
precisely
1430
I
1431
did
1432
initially
1433
,
1434
leading
1435
me
1436
the
1437
5
1438
4
1439
0
1440
.\n\n
1441
But
1442
,
1443
does
1444
like
1445
multiple
1446
answer
1447
is
1448
1449
5
1450
4
1451
0
1452
.\n\n
1453
Alternatively
1454
,
1455
but
1456
just
1457
to
1458
cross
1459
-check
1460
,
1461
another
1462
me
1463
think
1464
of
1465
a
1466
more
1467
case
1468
,
1469
Sup
1470
pose
1471
instead
1472
of
1473
1474
cars
1475
,
1476
we
1477
have
1478
two
1479
cars
1480
and
1481
three
1482
lanes
1483
.
1484
Then
1485
many
1486
ways
1487
are
1488
the
1489
stack
1490
up
1491
such
1492
both
1493
both
1494
lanes
1495
are
1496
occupied
1497
?\n\n
1498
By
1499
our
1500
same
1501
logic
1502
:
1503
total
1504
assignments
1505
=
1506
restrictions
1507
:
1508
1509
2
1510
^
1511
2
1512
=
1513
1514
4
1515
.\n\n
1516
Sub
1517
tract
1518
the
1519
two
1520
where
1521
one
1522
lane
1523
is
1524
empty
1525
:
1526
1527
2
1528
*
1529
1
1530
^
1531
2
1532
)
1533
=
1534
1535
2
1536
.\n\n
1537
So
1538
,
1539
total
1540
ways
1541
1542
4
1543
-
1544
1545
2
1546
=
1547
1548
2
1549
.\n\n
1550
Which
1551
indeed
1552
correct
1553
,
1554
since
1555
each
1556
two
1557
cars
1558
can
1559
be
1560
in
1561
two
1562
different
1563
orders
1564
(
1565
first
1566
car
1567
left
1568
,
1569
second
1570
straight
1571
;
1572
or
1573
first
1574
car
1575
straight
1576
,
1577
second
1578
left
1579
.\n\n
1580
Alternatively
1581
,
1582
with
1583
number
1584
of
1585
onto
1586
functions
1587
from
1588
1589
2
1590
cars
1591
to
1592
1593
2
1594
lanes
1595
is
1596
1597
2
1598
!
1599
*
1600
S
1601
(
1602
2
1603
,
1604
2
1605
)
1606
=
1607
1608
2
1609
*
1610
1611
1
1612
=
1613
1614
2
1615
.\n\n
1616
which
1617
matches
1618
correct
1619
.\n\n
1620
Another
1621
,
1622
another
1623
me
1624
think
1625
three
1626
three
1627
cars
1628
and
1629
two
1630
lanes
1631
.\n\n
1632
Total
1633
ways
1634
:
1635
1636
2
1637
^
1638
3
1639
=
1640
1641
8
1642
.\n\n
1643
Sub
1644
tract
1645
cases
1646
where
1647
one
1648
lane
1649
is
1650
empty
1651
:
1652
1653
2
1654
*(
1655
1
1656
^
1657
3
1658
)
1659
=
1660
1661
2
1662
.\n\n
1663
Thus
1664
,
1665
total
1666
=
1667
1668
8
1669
-
1670
1671
2
1672
=
1673
1674
6
1675
.\n\n
1676
But
1677
how
1678
,
1679
using
1680
number
1681
of
1682
ways
1683
where
1684
both
1685
lanes
1686
are
1687
occupied
1688
with
1689
the
1690
2
1691
,
1692
right
1693
is
1694
equivalent
1695
2
1696
!
1697
*
1698
S
1699
(
1700
3
1701
,
1702
2
1703
)
1704
=
1705
1706
2
1707
*
1708
1709
3
1710
=
1711
1712
6
1713
.
1714
Which
1715
is
1716
correct
1717
since
1718
For
1719
,
1720
the
1721
inclusion
1722
seems
1723
to
1724
hold
1725
up
1726
Wait
1727
,
1728
in
1729
the
1730
problem
1731
of
1732
our
1733
cars
1734
and
1735
three
1736
lanes
1737
.\n\n
1738
the
1739
total
1740
of
1741
assignments
1742
functions
1743
would
1744
1745
3
1746
!
1747
*
1748
S
1749
(
1750
3
1751
,
1752
3
1753
)
1754
=
1755
1756
6
1757
*
1758
1759
1
1760
=
1761
1762
6
1763
.\n\n
1764
Which
1765
also
1766
correct
1767
:
1768
as
1769
each
1770
car
1771
must
1772
be
1773
assigned
1774
to
1775
to
1776
each
1777
lane
1778
.\n\n
1779
so
1780
1781
3
1782
!
1783
=
1784
1785
6
1786
.\n\n
1787
Alternatively
1788
,
1789
the
1790
formula
1791
seems
1792
to
1793
for
1794
Therefore
1795
,
1796
when
1797
back
1798
,
1799
with
1800
six
1801
cars
1802
and
1803
three
1804
lanes
1805
,
1806
the
1807
number
1808
is
1809
1810
5
1811
4
1812
0
1813
.\n\n
1814
Therefore
1815
,
1816
I
1817
can
1818
I
1819
can
1820
confidently
1821
confident
1822
the
1823
the
1824
answer
1825
is
1826
1827
5
1828
4
1829
0
1830
.\n\n
1831
Just
1832
,
1833
but
1834
just
1835
another
1836
challenge
1837
sure
1838
,
1839
perhaps
1840
I
1841
should
1842
compute
1843
of
1844
another
1845
as
1846
assigning
1847
the
1848
car
1849
to
1850
a
1851
lane
1852
,
1853
then
1854
ordering
1855
subtract
1856
ing
1857
the
1858
cases
1859
where
1860
one
1861
or
1862
more
1863
lanes
1864
are
1865
empty
1866
.\n\n
1867
Total
1868
,
1869
similar
1870
steps
1871
inclusion
1872
-ex
1873
clusion
1874
:\n\n
1875
Total
1876
number
1877
of
1878
ways
1879
:
1880
1881
3
1882
^
1883
6
1884
.\n\n
1885
1886
7
1887
2
1888
9
1889
.\n\n
1890
Number
1891
of
1892
assignments
1893
with
1894
the
1895
lane
1896
is
1897
empty
1898
:
1899
1900
2
1901
^
1902
6
1903
=
1904
1905
6
1906
4
1907
.\n\n
1908
Number
1909
,
1910
assignments
1911
where
1912
straight
1913
-going
1914
is
1915
empty
1916
:
1917
1918
6
1919
4
1920
,
1921
Similarly
1922
assignments
1923
where
1924
right
1925
-turn
1926
is
1927
empty
1928
:
1929
1930
6
1931
4
1932
.\n\n
1933
So
1934
,
1935
subtract
1936
these
1937
3
1938
*
1939
6
1940
4
1941
=
1942
1943
1
1944
9
1945
2
1946
.\n\n
1947
But
1948
as
1949
,
1950
we
1951
've
1952
subtract
1953
ed
1954
too
1955
much
1956
those
1957
the
1958
assignments
1959
where
1960
two
1961
lanes
1962
are
1963
empty
1964
have
1965
been
1966
subtract
1967
ed
1968
twice
1969
times
1970
.
1971
Number
1972
,
1973
how
1974
many
1975
assignments
1976
have
1977
both
1978
lanes
1979
empty
1980
?\n\n
1981
If
1982
left
1983
and
1984
straight
1985
are
1986
empty
1987
:
1988
all
1989
six
1990
go
1991
go
1992
right
1993
:
1994
only
1995
1
1996
way
1997
.\n\n
1998
Similarly
1999
,
2000
if
2001
and
2002
right
2003
empty
2004
:
2005
all
2006
cars
2007
go
2008
straight
2009
:
2010
2011
1
2012
way
2013
.\n\n
2014
Straight
2015
and
2016
right
2017
empty
2018
:
2019
all
2020
cars
2021
go
2022
left
2023
:
2024
2025
1
2026
way
2027
.\n\n
2028
Total
2029
,
2030
three
2031
such
2032
assignments
2033
,
2034
each
2035
with
2036
2037
1
2038
.\n\n
2039
So
2040
,
2041
we
2042
have
2043
to
2044
add
2045
them
2046
back
2047
in
2048
.\n\n
2049
So
2050
,
2051
add
2052
2053
3
2054
*
2055
1
2056
=
2057
2058
3
2059
.\n\n
2060
Therefore
2061
,
2062
total
2063
number
2064
is
2065
assignments
2066
with
2067
no
2068
lanes
2069
are
2070
empty
2071
is
2072
2073
7
2074
2
2075
9
2076
-
2077
2078
1
2079
9
2080
2
2081
+
2082
2083
3
2084
=
2085
2086
5
2087
4
2088
0
2089
.\n\n
2090
Yes
2091
,
2092
so
2093
matches
2094
as
2095
.\n\n
2096
Therefore
2097
,
2098
I
2099
don
2100
be
2101
confident
2102
the
2103
the
2104
5
2105
4
2106
0
2107
is
2108
the
2109
correct
2110
answer
2111
.\n\n
2112
Thus
2113
,
2114
the
2115
way
2116
of
2117
ways
2118
the
2119
six
2120
cars
2121
can
2122
stack
2123
up
2124
at
2125
the
2126
intersection
2127
with
2128
all
2129
three
2130
lanes
2131
occupied
2132
is
2133
2134
5
2135
4
2136
0
2137
.\n\n
2138
**
2139
Final
2140
Answer
2141
**\n
2142
The
2143
number
2144
of
2145
ways
2146
is
2147
\
2148
boxed
2149
{
2150
5
2151
4
2152
0
2153
}.\n
2154
</think>
2155
\n\n
2156
To
2157
determine
2158
the
2159
number
2160
of
2161
ways
2162
six
2163
distinguish
2164
able
2165
cars
2166
can
2167
stack
2168
up
2169
at
2170
a
2171
red
2172
light
2173
such
2174
that
2175
all
2176
three
2177
lanes
2178
(
2179
left
2180
-turn
2181
,
2182
straight
2183
-going
2184
,
2185
and
2186
right
2187
-turn
2188
)
2189
are
2190
occupied
2191
,
2192
we
2193
use
2194
the
2195
principle
2196
of
2197
inclusion
2198
-ex
2199
clusion
2200
.\n\n
2201
1
2202
.
2203
Calculate
2204
the
2205
total
2206
number
2207
of
2208
unrestricted
2209
ways
2210
the
2211
cars
2212
can
2213
choose
2214
their
2215
lanes
2216
:\n
2217
2218
\
2219
[\n
2220
2221
2222
3
2223
^
2224
6
2225
=
2226
2227
7
2228
2
2229
9
2230
\n
2231
2232
\
2233
]\n\n
2234
2
2235
.
2236
Subtract
2237
the
2238
number
2239
of
2240
ways
2241
where
2242
at
2243
least
2244
one
2245
lane
2246
is
2247
empty
2248
.
2249
There
2250
are
2251
three
2252
lanes
2253
,
2254
so
2255
the
2256
number
2257
of
2258
ways
2259
for
2260
each
2261
lane
2262
to
2263
be
2264
empty
2265
is
2266
:\n
2267
2268
\
2269
[\n
2270
2271
2272
2
2273
^
2274
6
2275
=
2276
2277
6
2278
4
2279
\n
2280
2281
\
2282
]\n
2283
2284
Therefore
2285
,
2286
total
2287
ways
2288
for
2289
one
2290
lane
2291
being
2292
empty
2293
:\n
2294
2295
\
2296
[\n
2297
2298
2299
3
2300
\
2301
times
2302
2303
6
2304
4
2305
=
2306
2307
1
2308
9
2309
2
2310
\n
2311
2312
\
2313
]\n\n
2314
3
2315
.
2316
Add
2317
back
2318
the
2319
cases
2320
where
2321
two
2322
lanes
2323
are
2324
empty
2325
,
2326
since
2327
these
2328
were
2329
subtract
2330
ed
2331
too
2332
many
2333
times
2334
.
2335
There
2336
are
2337
three
2338
pairs
2339
of
2340
lanes
2341
,
2342
and
2343
each
2344
pair
2345
contributes
2346
2347
1
2348
way
2349
:\n
2350
2351
\
2352
[\n
2353
2354
2355
3
2356
\
2357
times
2358
2359
1
2360
=
2361
2362
3
2363
\n
2364
2365
\
2366
]\n\n
2367
4
2368
.
2369
Apply
2370
the
2371
inclusion
2372
-ex
2373
clusion
2374
principle
2375
:\n
2376
2377
\
2378
[\n
2379
2380
2381
7
2382
2
2383
9
2384
-
2385
2386
1
2387
9
2388
2
2389
+
2390
2391
3
2392
=
2393
2394
5
2395
4
2396
0
2397
\n
2398
2399
\
2400
]\n\n
2401
Thus
2402
,
2403
the
2404
number
2405
of
2406
ways
2407
the
2408
six
2409
cars
2410
can
2411
stack
2412
up
2413
so
2414
that
2415
all
2416
three
2417
lanes
2418
are
2419
occupied
2420
is
2421
\
2422
(\
2423
boxed
2424
{
2425
5
2426
4
2427
0
2428
}\
2429
).
2430
<|end▁of▁sentence|>' (SPECIAL)
Sample 2
1
Alright
2
,
3
so
4
I
5
've
6
this
7
problem
8
where
9
six
10
cars
11
come
12
pulling
13
a
14
red
15
light
16
and
17
and
18
they
19
can
20
choose
21
to
22
three
23
lanes
24
:
25
left
26
-turn
27
,
28
straight
29
-going
30
,
31
or
32
right
33
-turn
34
.
35
I
36
need
37
to
38
figure
39
out
40
how
41
many
42
different
43
ways
44
the
45
six
46
cars
47
can
48
stack
49
up
50
at
51
the
52
intersection
53
such
54
that
55
all
56
three
57
lanes
58
are
59
occupied
60
.
61
\n\n
62
cars
63
are
64
distinguish
65
able
66
,
67
and
68
each
69
one
70
is
71
unique
72
,
73
and
74
they
75
order
76
in
77
which
78
they
79
approach
80
is
81
fixed
82
.\n\n
83
Hmm
84
,
85
car
86
cars
87
car
88
gets
89
first
90
,
91
then
92
the
93
second
94
,
95
and
96
so
97
on
98
until
99
to
100
the
101
sixth
102
.
103
\n\n
104
Hmm
105
.
106
Let
107
me
108
break
109
to
110
break
111
this
112
down
113
.
114
First
115
the
116
car
117
has
118
three
119
choices
120
,
121
without
122
could
123
think
124
initially
125
first
126
that
127
there
128
total
129
number
130
of
131
possible
132
ways
133
they
134
can
135
stack
136
their
137
lanes
138
is
139
140
3
141
^
142
6
143
.
144
Because
145
wait
146
,
147
that
148
includes
149
be
150
the
151
case
152
if
153
they
154
problem
155
of
156
't
157
matter
158
or
159
but
160
here
161
the
162
since
163
order
164
does
165
matter
166
because
167
each
168
cars
169
are
170
coming
171
able
172
and
173
pull
174
pull
175
sequentially
176
at
177
another
178
.
179
However
180
maybe
181
that
182
each
183
arrangement
184
is
185
a
186
permutation
187
with
188
repetition
189
?
190
So
191
yes
192
yeah
193
,
194
I
195
that
196
each
197
number
198
should
199
possible
200
without
201
any
202
restrictions
203
would
204
indeed
205
206
3
207
multiplied
208
6
209
,
210
which
211
is
212
213
7
214
2
215
9
216
.
217
But
218
that
219
problem
220
specifies
221
that
222
all
223
three
224
lanes
225
must
226
be
227
occupied
228
.
229
That
230
I
231
I
232
can
233
to
234
subtract
235
the
236
cases
237
where
238
one
239
or
240
more
241
lanes
242
are
243
empty
244
.\n\n
245
This
246
feels
247
like
248
a
249
inclusion
250
-ex
251
clusion
252
problem
253
.
254
I
255
comb
256
-ex
257
clusion
258
is
259
a
260
principle
261
in
262
you
263
can
264
find
265
the
266
number
267
of
268
elements
269
in
270
a
271
union
272
of
273
sets
274
sets
275
by
276
adding
277
and
278
excluding
279
the
280
sizes
281
of
282
various
283
intersections
284
.
285
So
286
,
287
maybe
288
that
289
here
290
,
291
I
292
need
293
to
294
subtract
295
the
296
cases
297
where
298
only
299
lane
300
is
301
empty
302
,
303
but
304
then
305
add
306
back
307
in
308
the
309
cases
310
where
311
two
312
lanes
313
are
314
empty
315
because
316
we
317
cases
318
subtract
319
ed
320
too
321
many
322
times
323
.\n\n
324
Let
325
's
326
structure
327
this
328
out
329
.\n\n
330
First
331
,
332
total
333
number
334
of
335
ways
336
:
337
any
338
restrictions
339
is
340
341
3
342
^
343
6
344
.\n\n
345
346
7
347
2
348
9
349
.\n\n
350
Now
351
,
352
the
353
the
354
number
355
of
356
ways
357
where
358
one
359
least
360
one
361
lane
362
is
363
empty
364
.\n\n
365
There
366
are
367
three
368
lanes
369
,
370
so
371
how
372
number
373
of
374
ways
375
where
376
the
377
left
378
-turn
379
lane
380
is
381
empty
382
is
383
384
2
385
^
386
6
387
because
388
since
389
each
390
car
391
has
392
either
393
choose
394
between
395
straight
396
-going
397
and
398
right
399
-turn
400
lanes
401
.
402
Similarly
403
,
404
the
405
number
406
of
407
ways
408
where
409
the
410
straight
411
-going
412
lane
413
is
414
empty
415
is
416
417
2
418
^
419
6
420
,
421
and
422
the
423
number
424
of
425
ways
426
where
427
the
428
right
429
-turn
430
lane
431
is
432
empty
433
is
434
also
435
436
2
437
^
438
6
439
.\n\n
440
So
441
,
442
subtract
443
ing
444
these
445
,
446
it
447
have
448
:\n\n
449
7
450
*(
451
2
452
^
453
6
454
).
455
=
456
457
3
458
*
459
6
460
4
461
=
462
463
1
464
9
465
2
466
.
467
But
468
wait
469
,
470
now
471
we
472
've
473
subtract
474
ed
475
too
476
much
477
because
478
the
479
cases
480
where
481
two
482
lanes
483
are
484
empty
485
have
486
been
487
subtract
488
ed
489
multiple
490
times
491
.
492
Each
493
,
494
we
495
have
496
to
497
add
498
them
499
back
500
in
501
.\n\n
502
How
503
many
504
ways
505
are
506
there
507
where
508
two
509
lanes
510
are
511
empty
512
?
513
For
514
each
515
,
516
if
517
both
518
the
519
left
520
-turn
521
and
522
straight
523
-going
524
lanes
525
are
526
empty
527
,
528
all
529
cars
530
must
531
go
532
right
533
.
534
Similarly
535
's
536
only
537
538
1
539
way
540
for
541
that
542
pair
543
of
544
lanes
545
.
546
There
547
there
548
are
549
C
550
(
551
3
552
,
553
2
554
)
555
=
556
557
3
558
such
559
of
560
lanes
561
,
562
each
563
contributing
564
565
1
566
^
567
(
568
we
569
we
570
add
571
back
572
573
3
574
*(
575
1
576
^
577
578
3
579
.\n\n
580
Therefore
581
,
582
applying
583
inclusion
584
-ex
585
clusion
586
,
587
the
588
total
589
number
590
of
591
ways
592
where
593
all
594
three
595
lanes
596
are
597
occupied
598
is
599
:\n\n
600
Total
601
=
602
603
3
604
^
605
6
606
-
607
608
3
609
*(
610
2
611
^
612
6
613
)
614
+
615
616
3
617
*(
618
1
619
^
620
6
621
)\n
622
Pl
623
ating
624
that
625
:\n\n
626
3
627
^
628
6
629
=
630
631
7
632
2
633
9
634
\n\n
635
3
636
*(
637
2
638
^
639
6
640
)
641
=
642
643
3
644
*
645
6
646
4
647
=
648
649
1
650
9
651
2
652
\n\n
653
3
654
*(
655
1
656
^
657
6
658
)
659
=
660
661
3
662
*
663
1
664
=
665
666
3
667
\n\n
668
So
669
,\n\n
670
Total
671
=
672
673
7
674
2
675
9
676
-
677
678
1
679
9
680
2
681
+
682
683
3
684
\n\n
685
Let
686
me
687
compute
688
that
689
step
690
by
691
step
692
:\n\n
693
7
694
2
695
9
696
-
697
698
1
699
9
700
2
701
=
702
703
5
704
3
705
7
706
\n\n
707
5
708
3
709
7
710
+
711
712
3
713
=
714
715
5
716
4
717
0
718
\n\n
719
So
720
,
721
is
722
total
723
number
724
is
725
ways
726
is
727
728
5
729
4
730
0
731
?
732
Hmm
733
,
734
but
735
let
736
me
737
make
738
again
739
.
740
Is
741
the
742
correct
743
correct
744
approach
745
?\n\n
746
In
747
,
748
another
749
way
750
to
751
think
752
about
753
this
754
is
755
using
756
the
757
principle
758
of
759
inclusion
760
-ex
761
clusion
762
for
763
sur
764
jective
765
functions
766
.
767
Since
768
each
769
have
770
all
771
three
772
lanes
773
occupied
774
have
775
at
776
least
777
one
778
car
779
,
780
which
781
is
782
equivalent
783
to
784
the
785
the
786
number
787
of
788
onto
789
functions
790
from
791
the
792
set
793
of
794
six
795
cars
796
to
797
the
798
three
799
lanes
800
.
801
The
802
formula
803
for
804
that
805
is
806
:\n\n
807
808
3
809
!
810
*
811
S
812
(
813
6
814
,
815
3
816
),
817
where
818
S
819
(
820
6
821
,
822
3
823
)
824
is
825
the
826
St
827
irling
828
numbers
829
of
830
the
831
second
832
kind
833
,
834
representing
835
count
836
the
837
number
838
of
839
ways
840
to
841
partition
842
a
843
set
844
of
845
six
846
objects
847
into
848
k
849
non
850
-empty
851
subsets
852
.\n\n
853
But
854
considering
855
,
856
the
857
this
858
case
859
,
860
is
861
cars
862
are
863
labeled
864
able
865
,
866
and
867
the
868
lanes
869
are
870
distinguish
871
able
872
,
873
so
874
the
875
number
876
of
877
onto
878
functions
879
is
880
881
882
3
883
!
884
*
885
S
886
(
887
6
888
,
889
3
890
).
891
\n\n
892
I
893
me
894
check
895
,
896
St
897
number
898
is
899
St
900
irling
901
numbers
902
is
903
the
904
second
905
kind
906
S
907
S
908
(n
909
,k
910
)
911
=
912
S
913
(n
914
-
915
1
916
,k
917
-
918
1
919
)
920
+
921
k
922
*S
923
(n
924
-
925
1
926
,k
927
).
928
So
929
,
930
I
931
maybe
932
I
933
can
934
compute
935
S
936
(
937
6
938
,
939
3
940
)?\n\n
941
But
942
another
943
we
944
'm
945
compute
946
S
947
directly
948
.
949
Alternatively
950
,
951
I
952
can
953
use
954
inclusion
955
-ex
956
clusion
957
formula
958
as
959
done
960
,
961
Hold
962
,
963
actually
964
hold
965
on
966
,
967
let
968
's
969
make
970
sure
971
about
972
our
973
results
974
.\n\n
975
The
976
inclusion
977
of
978
onto
979
functions
980
from
981
a
982
set
983
of
984
size
985
n
986
to
987
a
988
set
989
of
990
size
991
k
992
is
993
given
994
given
995
!
996
*
997
S
998
(n
999
,k
1000
).
1001
\n\n
1002
,
1003
for
1004
S
1005
=
1006
6
1007
,
1008
k
1009
=
1010
3
1011
,
1012
it
1013
is
1014
be
1015
1016
6
1017
!
1018
*
1019
S
1020
(
1021
6
1022
,
1023
3
1024
).\n\n
1025
But
1026
1027
is
1028
S
1029
(
1030
6
1031
,
1032
3
1033
)?
1034
Calcul
1035
think
1036
if
1037
(
1038
6
1039
,
1040
3
1041
)
1042
can
1043
be
1044
calculated
1045
as
1046
formula
1047
-ex
1048
clusion
1049
as
1050
well
1051
.\n\n
1052
Alternatively
1053
,
1054
maybe
1055
can
1056
think
1057
that
1058
:\n\n
1059
(n
1060
,k
1061
)
1062
=
1063
S
1064
1
1065
/k
1066
!
1067
*
1068
sum
1069
_{
1070
i
1071
=
1072
0
1073
to
1074
k
1075
}
1076
(-
1077
1
1078
)^
1079
i
1080
*
1081
C
1082
(k
1083
,i
1084
)
1085
*
1086
(
1087
k
1088
-
1089
i
1090
)^
1091
n
1092
}\n\n
1093
But
1094
for
1095
for
1096
S
1097
(
1098
6
1099
,
1100
3
1101
),
1102
S
1103
(
1104
6
1105
,
1106
3
1107
)
1108
=
1109
(
1110
1
1111
/
1112
3
1113
!)
1114
*
1115
[
1116
C
1117
(
1118
3
1119
,
1120
0
1121
)*
1122
3
1123
^
1124
6
1125
-
1126
C
1127
(
1128
3
1129
,
1130
1
1131
)*
1132
2
1133
^
1134
6
1135
+
1136
C
1137
(
1138
3
1139
,
1140
2
1141
)*
1142
1
1143
^
1144
6
1145
-
1146
C
1147
(
1148
3
1149
,
1150
3
1151
)*
1152
0
1153
^
1154
6
1155
]\n\n
1156
So
1157
is
1158
same
1159
1
1160
/
1161
6
1162
)*(
1163
1
1164
*
1165
7
1166
2
1167
9
1168
-
1169
1170
3
1171
*
1172
6
1173
4
1174
+
1175
1176
3
1177
*
1178
1
1179
-
1180
1181
1
1182
*
1183
0
1184
]
1185
=
1186
(
1187
1
1188
/
1189
6
1190
)[
1191
7
1192
2
1193
9
1194
-
1195
1196
1
1197
9
1198
2
1199
+
1200
1201
3
1202
)
1203
=
1204
same
1205
1
1206
/
1207
6
1208
)(
1209
5
1210
4
1211
0
1212
)
1213
=
1214
1215
9
1216
0
1217
.\n\n
1218
Therefore
1219
,
1220
S
1221
(
1222
6
1223
,
1224
3
1225
)
1226
=
1227
1228
9
1229
0
1230
.\n\n
1231
Therefore
1232
,
1233
the
1234
number
1235
of
1236
onto
1237
functions
1238
is
1239
1240
3
1241
!
1242
*
1243
1244
9
1245
0
1246
=
1247
1248
6
1249
*
1250
1251
9
1252
0
1253
=
1254
1255
5
1256
4
1257
0
1258
.\n\n
1259
Which
1260
matches
1261
our
1262
earlier
1263
before
1264
earlier
1265
-ex
1266
clusion
1267
above
1268
.
1269
So
1270
,
1271
that
1272
confirms
1273
consistent
1274
.\n\n
1275
H
1276
,
1277
both
1278
methods
1279
give
1280
me
1281
1282
5
1283
4
1284
0
1285
,
1286
Wait
1287
,
1288
but
1289
let
1290
me
1291
just
1292
think
1293
of
1294
this
1295
different
1296
perspective
1297
.
1298
be
1299
sure
1300
.\n\n
1301
Sup
1302
pose
1303
I
1304
think
1305
this
1306
arrangement
1307
as
1308
assigning
1309
each
1310
of
1311
the
1312
six
1313
cars
1314
to
1315
one
1316
of
1317
three
1318
three
1319
lanes
1320
,
1321
such
1322
the
1323
condition
1324
that
1325
each
1326
lane
1327
is
1328
at
1329
least
1330
one
1331
car
1332
.
1333
So
1334
,
1335
it
1336
number
1337
is
1338
assignments
1339
assignments
1340
is
1341
the
1342
to
1343
the
1344
inclusion
1345
of
1346
ways
1347
to
1348
distribute
1349
six
1350
distinguish
1351
able
1352
objects
1353
into
1354
three
1355
distinguish
1356
able
1357
boxes
1358
,
1359
each
1360
box
1361
containing
1362
at
1363
least
1364
one
1365
object
1366
.\n\n
1367
And
1368
we
1369
again
1370
the
1371
inclusion
1372
of
1373
sur
1374
functions
1375
,
1376
or
1377
same
1378
,
1379
1380
5
1381
!
1382
*
1383
S
1384
(
1385
6
1386
,
1387
3
1388
)
1389
=
1390
1391
5
1392
4
1393
0
1394
,
1395
Alternatively
1396
,
1397
let
1398
can
1399
think
1400
of
1401
it
1402
as
1403
first
1404
assigning
1405
each
1406
of
1407
the
1408
six
1409
cars
1410
to
1411
a
1412
lane
1413
,
1414
then
1415
subtract
1416
ing
1417
the
1418
distributions
1419
where
1420
a
1421
or
1422
more
1423
lanes
1424
are
1425
empty
1426
.
1427
Which
1428
still
1429
what
1430
we
1431
did
1432
earlier
1433
.\n\n
1434
with
1435
to
1436
1437
5
1438
4
1439
0
1440
.\n\n
1441
Just
1442
,
1443
perhaps
1444
like
1445
the
1446
answer
1447
is
1448
consistent
1449
5
1450
4
1451
0
1452
.\n\n
1453
Wait
1454
,
1455
now
1456
another
1457
to
1458
think
1459
-check
1460
,
1461
maybe
1462
me
1463
plug
1464
in
1465
arranging
1466
smaller
1467
case
1468
.\n\n
1469
Sup
1470
pose
1471
there
1472
of
1473
six
1474
cars
1475
,
1476
let
1477
have
1478
two
1479
cars
1480
and
1481
three
1482
lanes
1483
.
1484
How
1485
many
1486
ways
1487
can
1488
they
1489
stack
1490
up
1491
so
1492
that
1493
both
1494
lanes
1495
are
1496
occupied
1497
.\n\n
1498
Using
1499
the
1500
formula
1501
method
1502
:\n\n
1503
1504
ways
1505
without
1506
restriction
1507
is
1508
1509
2
1510
^
1511
2
1512
=
1513
1514
4
1515
.\n\n
1516
Sub
1517
tract
1518
the
1519
cases
1520
where
1521
one
1522
lane
1523
is
1524
empty
1525
:
1526
1527
2
1528
*(
1529
1
1530
^
1531
2
1532
)
1533
=
1534
1535
2
1536
.\n\n
1537
So
1538
,
1539
1540
=
1541
1542
4
1543
-
1544
1545
2
1546
=
1547
1548
2
1549
.\n\n
1550
But
1551
makes
1552
correct
1553
:
1554
because
1555
the
1556
two
1557
cars
1558
must
1559
be
1560
split
1561
either
1562
different
1563
lanes
1564
:
1565
first
1566
car
1567
left
1568
,
1569
second
1570
straight
1571
;
1572
or
1573
first
1574
car
1575
straight
1576
,
1577
second
1578
left
1579
.
1580
Alternatively
1581
,
1582
another
1583
number
1584
of
1585
onto
1586
functions
1587
from
1588
1589
2
1590
cars
1591
to
1592
1593
2
1594
lanes
1595
is
1596
1597
2
1598
!
1599
*
1600
S
1601
(
1602
2
1603
,
1604
2
1605
)
1606
=
1607
1608
2
1609
*
1610
1611
1
1612
=
1613
1614
2
1615
.
1616
which
1617
is
1618
correct
1619
.\n\n
1620
Another
1621
,
1622
let
1623
us
1624
test
1625
with
1626
n
1627
cars
1628
and
1629
two
1630
lanes
1631
.\n\n
1632
Total
1633
without
1634
:
1635
1636
2
1637
^
1638
3
1639
=
1640
1641
8
1642
.\n\n
1643
Number
1644
tract
1645
cases
1646
where
1647
one
1648
lane
1649
is
1650
empty
1651
:
1652
1653
2
1654
*(
1655
1
1656
^
1657
3
1658
)
1659
=
1660
1661
2
1662
.\n\n
1663
Total
1664
,
1665
number
1666
onto
1667
1668
8
1669
-
1670
1671
2
1672
=
1673
1674
6
1675
.\n\n
1676
But
1677
also
1678
,
1679
the
1680
number
1681
of
1682
sur
1683
where
1684
both
1685
lanes
1686
are
1687
occupied
1688
is
1689
1690
6
1691
,
1692
which
1693
makes
1694
also
1695
2
1696
!
1697
*
1698
S
1699
(
1700
3
1701
,
1702
2
1703
)
1704
=
1705
1706
2
1707
*
1708
1709
3
1710
=
1711
1712
6
1713
.
1714
That
1715
is
1716
correct
1717
.\n\n
1718
So
1719
,
1720
the
1721
formula
1722
seems
1723
consistent
1724
hold
1725
up
1726
So
1727
,
1728
if
1729
the
1730
case
1731
where
1732
three
1733
cars
1734
and
1735
three
1736
lanes
1737
,
1738
the
1739
number
1740
of
1741
onto
1742
functions
1743
is
1744
1745
3
1746
!
1747
*
1748
S
1749
(
1750
3
1751
,
1752
3
1753
)
1754
=
1755
1756
6
1757
*
1758
1759
1
1760
=
1761
1762
6
1763
.\n\n
1764
Which
1765
makes
1766
the
1767
since
1768
since
1769
each
1770
lane
1771
can
1772
be
1773
assigned
1774
uniquely
1775
to
1776
a
1777
lane
1778
,
1779
and
1780
1781
3
1782
!
1783
ways
1784
1785
6
1786
,
1787
Therefore
1788
,
1789
going
1790
same
1791
holds
1792
consistent
1793
.\n\n
1794
Therefore
1795
,
1796
applying
1797
back
1798
,
1799
for
1800
six
1801
cars
1802
and
1803
three
1804
lanes
1805
,
1806
the
1807
number
1808
of
1809
1810
5
1811
4
1812
0
1813
.\n\n
1814
But
1815
,
1816
I
1817
think
1818
I
1819
'm
1820
be
1821
confident
1822
that
1823
1824
answer
1825
is
1826
1827
5
1828
4
1829
0
1830
.\n\n
1831
Wait
1832
,
1833
but
1834
just
1835
to
1836
make
1837
entirely
1838
I
1839
I
1840
I
1841
mis
1842
think
1843
in
1844
it
1845
as
1846
assigning
1847
each
1848
position
1849
independently
1850
a
1851
lane
1852
,
1853
and
1854
then
1855
accounting
1856
ing
1857
those
1858
cases
1859
where
1860
lanes
1861
lane
1862
more
1863
lanes
1864
are
1865
empty
1866
.\n\n
1867
So
1868
,
1869
same
1870
as
1871
In
1872
-ex
1873
clusion
1874
.
1875
Total
1876
number
1877
of
1878
functions
1879
:
1880
1881
3
1882
^
1883
6
1884
=
1885
1886
7
1887
2
1888
9
1889
.\n\n
1890
Number
1891
of
1892
assignments
1893
where
1894
a
1895
-turn
1896
is
1897
empty
1898
:
1899
1900
2
1901
^
1902
6
1903
=
1904
1905
6
1906
4
1907
.\n\n
1908
Similarly
1909
,
1910
assignments
1911
where
1912
straight
1913
-going
1914
is
1915
empty
1916
:
1917
1918
6
1919
4
1920
.\n\n
1921
And
1922
,
1923
where
1924
right
1925
-turn
1926
is
1927
empty
1928
:
1929
1930
6
1931
4
1932
.\n\n
1933
So
1934
,
1935
subtract
1936
1937
3
1938
*
1939
6
1940
4
1941
=
1942
1943
1
1944
9
1945
2
1946
.\n\n
1947
But
1948
now
1949
,
1950
assignments
1951
have
1952
subtract
1953
ed
1954
too
1955
much
1956
because
1957
the
1958
cases
1959
where
1960
two
1961
lanes
1962
are
1963
empty
1964
have
1965
been
1966
subtract
1967
ed
1968
multiple
1969
times
1970
.\n\n
1971
So
1972
,
1973
we
1974
many
1975
cases
1976
have
1977
two
1978
lanes
1979
empty
1980
?\n\n
1981
If
1982
two
1983
and
1984
straight
1985
are
1986
empty
1987
:
1988
all
1989
six
1990
must
1991
go
1992
right
1993
:
1994
1995
1
1996
way
1997
.\n\n
1998
Similarly
1999
,
2000
left
2001
and
2002
right
2003
empty
2004
:
2005
all
2006
cars
2007
straight
2008
straight
2009
:
2010
2011
1
2012
way
2013
.\n\n
2014
Straight
2015
and
2016
right
2017
empty
2018
:
2019
all
2020
cars
2021
go
2022
left
2023
:
2024
2025
1
2026
way
2027
.\n\n
2028
Thus
2029
,
2030
three
2031
assignments
2032
cases
2033
,
2034
each
2035
contributing
2036
2037
1
2038
.\n\n
2039
So
2040
,
2041
we
2042
have
2043
subtract
2044
add
2045
those
2046
back
2047
.
2048
,
2049
So
2050
,
2051
+
2052
2053
3
2054
*
2055
1
2056
=
2057
2058
3
2059
.\n\n
2060
And
2061
,
2062
so
2063
is
2064
of
2065
onto
2066
is
2067
no
2068
lanes
2069
are
2070
empty
2071
is
2072
2073
7
2074
2
2075
9
2076
-
2077
2078
1
2079
9
2080
2
2081
+
2082
2083
3
2084
=
2085
2086
5
2087
4
2088
0
2089
.\n\n
2090
Therefore
2091
,
2092
that
2093
is
2094
again
2095
.\n\n
2096
Alternatively
2097
,
2098
seems
2099
can
2100
be
2101
confident
2102
that
2103
2104
5
2105
4
2106
0
2107
is
2108
the
2109
correct
2110
answer
2111
.\n\n
2112
Therefore
2113
,
2114
in
2115
number
2116
of
2117
ways
2118
is
2119
cars
2120
cars
2121
can
2122
stack
2123
up
2124
at
2125
the
2126
intersection
2127
so
2128
all
2129
three
2130
lanes
2131
occupied
2132
is
2133
2134
5
2135
4
2136
0
2137
.\n\n
2138
**
2139
Final
2140
Answer
2141
**\n
2142
The
2143
number
2144
of
2145
ways
2146
is
2147
\
2148
boxed
2149
{
2150
5
2151
4
2152
0
2153
}.\n
2154
</think>
2155
\n\n
2156
To
2157
determine
2158
the
2159
number
2160
of
2161
ways
2162
six
2163
distinguish
2164
able
2165
cars
2166
can
2167
stack
2168
up
2169
at
2170
a
2171
red
2172
light
2173
such
2174
that
2175
all
2176
three
2177
lanes
2178
(
2179
left
2180
-turn
2181
,
2182
straight
2183
-going
2184
,
2185
and
2186
right
2187
-turn
2188
)
2189
are
2190
occupied
2191
,
2192
we
2193
use
2194
the
2195
principle
2196
of
2197
inclusion
2198
-ex
2199
clusion
2200
.\n\n
2201
1
2202
.
2203
Calculate
2204
the
2205
total
2206
number
2207
of
2208
unrestricted
2209
ways
2210
the
2211
cars
2212
can
2213
choose
2214
their
2215
lanes
2216
:\n
2217
2218
\
2219
[\n
2220
2221
2222
3
2223
^
2224
6
2225
=
2226
2227
7
2228
2
2229
9
2230
\n
2231
2232
\
2233
]\n\n
2234
2
2235
.
2236
Subtract
2237
the
2238
number
2239
of
2240
ways
2241
where
2242
at
2243
least
2244
one
2245
lane
2246
is
2247
empty
2248
.
2249
There
2250
are
2251
three
2252
lanes
2253
,
2254
so
2255
the
2256
number
2257
of
2258
ways
2259
for
2260
each
2261
lane
2262
to
2263
be
2264
empty
2265
is
2266
:\n
2267
2268
\
2269
[\n
2270
2271
2272
2
2273
^
2274
6
2275
=
2276
2277
6
2278
4
2279
\n
2280
2281
\
2282
]\n
2283
2284
Therefore
2285
,
2286
total
2287
ways
2288
for
2289
one
2290
lane
2291
being
2292
empty
2293
:\n
2294
2295
\
2296
[\n
2297
2298
2299
3
2300
\
2301
times
2302
2303
6
2304
4
2305
=
2306
2307
1
2308
9
2309
2
2310
\n
2311
2312
\
2313
]\n\n
2314
3
2315
.
2316
Add
2317
back
2318
the
2319
cases
2320
where
2321
two
2322
lanes
2323
are
2324
empty
2325
,
2326
since
2327
these
2328
were
2329
subtract
2330
ed
2331
too
2332
many
2333
times
2334
.
2335
There
2336
are
2337
three
2338
pairs
2339
of
2340
lanes
2341
,
2342
and
2343
each
2344
pair
2345
contributes
2346
2347
1
2348
way
2349
:\n
2350
2351
\
2352
[\n
2353
2354
2355
3
2356
\
2357
times
2358
2359
1
2360
=
2361
2362
3
2363
\n
2364
2365
\
2366
]\n\n
2367
4
2368
.
2369
Apply
2370
the
2371
inclusion
2372
-ex
2373
clusion
2374
principle
2375
:\n
2376
2377
\
2378
[\n
2379
2380
2381
7
2382
2
2383
9
2384
-
2385
2386
1
2387
9
2388
2
2389
+
2390
2391
3
2392
=
2393
2394
5
2395
4
2396
0
2397
\n
2398
2399
\
2400
]\n\n
2401
Thus
2402
,
2403
the
2404
number
2405
of
2406
ways
2407
the
2408
six
2409
cars
2410
can
2411
stack
2412
up
2413
so
2414
that
2415
all
2416
three
2417
lanes
2418
are
2419
occupied
2420
is
2421
\
2422
(\
2423
boxed
2424
{
2425
5
2426
4
2427
0
2428
}\
2429
).
2430
<|end▁of▁sentence|>' (SPECIAL)
Sample 3
1
Alright
2
,
3
so
4
I
5
'm
6
this
7
problem
8
where
9
six
10
cars
11
are
12
arriving
13
a
14
red
15
light
16
,
17
and
18
they
19
can
20
choose
21
one
22
three
23
lanes
24
:
25
left
26
-turn
27
,
28
straight
29
-going
30
,
31
or
32
right
33
-turn
34
.
35
The
36
need
37
to
38
figure
39
out
40
how
41
many
42
different
43
ways
44
the
45
six
46
cars
47
can
48
stack
49
up
50
at
51
the
52
intersection
53
such
54
that
55
all
56
three
57
lanes
58
are
59
occupied
60
.
61
Hmm
62
cars
63
are
64
distinguish
65
able
66
,
67
meaning
68
each
69
car
70
is
71
unique
72
,
73
and
74
since
75
order
76
in
77
which
78
they
79
arrive
80
matters
81
fixed
82
.
83
\n\n
84
,
85
the
86
first
87
car
88
arrives
89
first
90
,
91
then
92
the
93
second
94
,
95
and
96
so
97
on
98
up
99
to
100
the
101
sixth
102
car
103
\n\n
104
First
105
.
106
Let
107
's
108
try
109
to
110
parse
111
this
112
down
113
.
114
Since
115
each
116
car
117
has
118
three
119
choices
120
,
121
I
122
guess
123
think
124
at
125
first
126
it
127
there
128
total
129
number
130
of
131
possible
132
ways
133
they
134
can
135
choose
136
their
137
lanes
138
is
139
just
140
3
141
^
142
6
143
.
144
But
145
wait
146
,
147
that
148
's
149
be
150
the
151
case
152
without
153
the
154
order
155
in
156
't
157
matter
158
,
159
but
160
since
161
,
162
the
163
cars
164
in
165
matter
166
because
167
the
168
cars
169
are
170
distinguish
171
able
172
and
173
arrive
174
come
175
one
176
after
177
another
178
.
179
So
180
,
181
maybe
182
each
183
arrangement
184
is
185
a
186
sequence
187
where
188
specific
189
?\n\n
190
\n\n
191
,
192
thinking
193
,
194
195
each
196
three
197
without
198
is
199
ways
200
is
201
any
202
restrictions
203
is
204
be
205
206
3
207
^
208
6
209
,
210
which
211
is
212
213
7
214
2
215
9
216
.\n\n
217
But
218
the
219
problem
220
specifies
221
that
222
we
223
three
224
lanes
225
must
226
be
227
occupied
228
.
229
So
230
,
231
I
232
need
233
to
234
subtract
235
the
236
scenarios
237
where
238
one
239
or
240
more
241
lanes
242
are
243
empty
244
.
245
This
246
seems
247
like
248
an
249
inclusion
250
-ex
251
clusion
252
principle
253
.
254
In
255
general
256
-ex
257
clusion
258
is
259
a
260
counting
261
that
262
you
263
can
264
calculate
265
the
266
number
267
of
268
elements
269
in
270
a
271
union
272
by
273
overlapping
274
sets
275
by
276
including
277
the
278
excluding
279
the
280
sizes
281
of
282
various
283
intersections
284
.
285
So
286
,
287
I
288
that
289
idea
290
,
291
perhaps
292
need
293
to
294
subtract
295
all
296
cases
297
where
298
one
299
lane
300
is
301
empty
302
,
303
but
304
then
305
add
306
back
307
in
308
the
309
cases
310
where
311
two
312
lanes
313
are
314
empty
315
because
316
those
317
have
318
subtract
319
ed
320
too
321
many
322
times
323
.\n\n
324
Alternatively
325
's
326
write
327
that
328
out
329
:\n\n
330
Total
331
,
332
total
333
number
334
of
335
ways
336
without
337
any
338
restrictions
339
:
340
341
3
342
^
343
6
344
=
345
346
7
347
2
348
9
349
.\n\n
350
Now
351
,
352
subtract
353
the
354
number
355
of
356
ways
357
where
358
at
359
least
360
one
361
lane
362
is
363
empty
364
.\n\n
365
There
366
are
367
three
368
lanes
369
,
370
so
371
the
372
number
373
of
374
ways
375
where
376
a
377
left
378
-turn
379
lane
380
is
381
empty
382
is
383
384
2
385
^
386
6
387
,
388
since
389
each
390
car
391
can
392
only
393
go
394
between
395
straight
396
or
397
and
398
right
399
-turn
400
lanes
401
.
402
Similarly
403
,
404
the
405
same
406
of
407
ways
408
where
409
the
410
straight
411
-going
412
lane
413
is
414
empty
415
is
416
417
2
418
^
419
6
420
,
421
and
422
the
423
number
424
of
425
ways
426
where
427
the
428
right
429
-turn
430
lane
431
is
432
empty
433
is
434
435
436
2
437
^
438
6
439
.\n\n
440
So
441
,
442
each
443
ing
444
these
445
,
446
we
447
get
448
449
3
450
*(
451
2
452
^
453
6
454
)
455
=
456
457
3
458
*
459
6
460
4
461
=
462
463
1
464
9
465
2
466
.\n\n
467
But
468
now
469
,
470
by
471
we
472
've
473
subtract
474
ed
475
too
476
much
477
,
478
when
479
cases
480
where
481
two
482
lanes
483
are
484
empty
485
have
486
been
487
subtract
488
ed
489
multiple
490
times
491
.
492
For
493
,
494
we
495
need
496
to
497
add
498
those
499
back
500
in
501
.\n\n
502
The
503
many
504
ways
505
are
506
there
507
where
508
two
509
lanes
510
are
511
empty
512
?
513
Well
514
each
515
,
516
if
517
both
518
the
519
left
520
-turn
521
and
522
straight
523
-going
524
lanes
525
are
526
empty
527
,
528
then
529
six
530
would
531
go
532
straight
533
.
534
There
535
's
536
only
537
538
1
539
way
540
for
541
each
542
such
543
of
544
lanes
545
.
546
Since
547
there
548
are
549
C
550
(
551
3
552
,
553
2
554
)
555
=
556
557
3
558
ways
559
of
560
lanes
561
(
562
each
563
with
564
565
1
566
way
567
where
568
so
569
adding
570
add
571
572
573
3
574
*
575
1
576
=
577
578
3
579
.\n\n
580
So
581
,
582
putting
583
inclusion
584
-ex
585
clusion
586
,
587
the
588
total
589
number
590
of
591
valid
592
where
593
all
594
three
595
lanes
596
are
597
occupied
598
is
599
:\n\n
600
Total
601
=
602
603
3
604
^
605
6
606
-
607
608
3
609
*(
610
2
611
^
612
6
613
)
614
+
615
616
3
617
*(
618
1
619
^
620
6
621
)\n\n
622
Calcul
623
ating
624
that
625
:\n\n
626
3
627
^
628
6
629
=
630
631
7
632
2
633
9
634
\n\n
635
2
636
*(
637
2
638
^
639
6
640
)
641
=
642
643
3
644
*
645
6
646
4
647
=
648
649
1
650
9
651
2
652
\n\n
653
3
654
*(
655
1
656
^
657
6
658
)
659
=
660
661
3
662
*
663
1
664
=
665
666
3
667
\n\n
668
So
669
,
670
Total
671
=
672
673
7
674
2
675
9
676
-
677
678
1
679
9
680
2
681
+
682
683
3
684
\n\n
685
Comput
686
me
687
compute
688
that
689
step
690
by
691
step
692
:\n\n
693
7
694
2
695
9
696
-
697
698
1
699
9
700
2
701
=
702
703
5
704
3
705
7
706
\n\n
707
5
708
3
709
7
710
+
711
712
3
713
=
714
715
5
716
4
717
0
718
\n\n
719
So
720
,
721
the
722
total
723
number
724
of
725
ways
726
is
727
728
5
729
4
730
0
731
.\n\n
732
Wait
733
,
734
let
735
let
736
me
737
think
738
again
739
.\n\n
740
Is
741
this
742
actually
743
same
744
approach
745
?\n\n
746
Alternatively
747
,
748
another
749
way
750
to
751
approach
752
about
753
it
754
is
755
using
756
the
757
principle
758
of
759
inclusion
760
-ex
761
clusion
762
but
763
counting
764
jective
765
functions
766
.
767
In
768
we
769
're
770
all
771
three
772
lanes
773
to
774
have
775
at
776
least
777
one
778
car
779
,
780
this
781
is
782
equivalent
783
to
784
finding
785
the
786
number
787
of
788
onto
789
functions
790
from
791
the
792
set
793
of
794
six
795
cars
796
to
797
the
798
set
799
lanes
800
.\n\n
801
\n\n
802
formula
803
for
804
this
805
is
806
indeed
807
808
3
809
!
810
*
811
S
812
(
813
6
814
,
815
3
816
),
817
where
818
S
819
(
820
6
821
,
822
3
823
)
824
is
825
the
826
St
827
irling
828
numbers
829
of
830
the
831
second
832
kind
833
.
834
counting
835
count
836
the
837
number
838
of
839
ways
840
to
841
partition
842
a
843
set
844
of
845
n
846
objects
847
into
848
k
849
non
850
-empty
851
subsets
852
.
853
But
854
wait
855
,
856
in
857
our
858
case
859
,
860
the
861
cars
862
are
863
ordered
864
able
865
,
866
and
867
the
868
order
869
are
870
distinguish
871
able
872
,
873
meaning
874
yes
875
formula
876
should
877
onto
878
functions
879
is
880
indeed
881
882
3
883
!
884
*
885
S
886
(
887
6
888
,
889
3
890
).
891
So
892
Alternatively
893
me
894
recall
895
that
896
St
897
formula
898
for
899
St
900
irling
901
numbers
902
of
903
the
904
second
905
kind
906
is
907
S
908
(n
909
,k
910
)
911
=
912
S
913
(n
914
-
915
1
916
,k
917
-
918
1
919
)
920
+
921
k
922
*S
923
(n
924
-
925
1
926
,k
927
).
928
So
929
,
930
perhaps
931
maybe
932
using
933
can
934
compute
935
S
936
(
937
6
938
,
939
3
940
).\n\n
941
But
942
perhaps
943
instead
944
can
945
recall
946
it
947
as
948
instead
949
But
950
,
951
I
952
can
953
compute
954
generating
955
-ex
956
clusion
957
,
958
.\n\n
959
above
960
.\n\n
961
Wait
962
,
963
if
964
our
965
on
966
.
967
conflict
968
me
969
make
970
sure
971
,
972
the
973
formula
974
.
975
Yes
976
number
977
of
978
onto
979
functions
980
from
981
a
982
set
983
of
984
size
985
n
986
to
987
a
988
set
989
of
990
size
991
k
992
is
993
equal
994
k
995
!
996
*
997
S
998
(n
999
,k
1000
).
1001
So
1002
,
1003
the
1004
n
1005
=
1006
6
1007
and
1008
k
1009
=
1010
3
1011
,
1012
it
1013
would
1014
be
1015
1016
3
1017
!
1018
*
1019
S
1020
(
1021
6
1022
,
1023
3
1024
).\n\n
1025
Let
1026
perhaps
1027
is
1028
S
1029
(
1030
6
1031
,
1032
3
1033
)?\n\n
1034
I
1035
recall
1036
S
1037
(
1038
6
1039
,
1040
3
1041
)
1042
can
1043
be
1044
calculated
1045
using
1046
inclusion
1047
-ex
1048
clusion
1049
as
1050
:\n\n
1051
.
1052
Rec
1053
,
1054
I
1055
remember
1056
refer
1057
that
1058
S
1059
(n
1060
,k
1061
)
1062
is
1063
sum
1064
1
1065
/k
1066
!)
1067
*
1068
Sum
1069
_{
1070
i
1071
=
1072
0
1073
to
1074
k
1075
}
1076
(-
1077
1
1078
)^
1079
i
1080
*
1081
C
1082
(k
1083
,i
1084
)
1085
*
1086
(
1087
k
1088
-
1089
i
1090
)^
1091
n
1092
}\n\n
1093
So
1094
,
1095
applying
1096
S
1097
(
1098
6
1099
,
1100
3
1101
):\n\n
1102
S
1103
(
1104
6
1105
,
1106
3
1107
)
1108
=
1109
(
1110
1
1111
/
1112
3
1113
!)
1114
[
1115
[
1116
C
1117
(
1118
3
1119
,
1120
0
1121
)*(
1122
3
1123
^
1124
6
1125
-
1126
C
1127
(
1128
3
1129
,
1130
1
1131
)*
1132
2
1133
^
1134
6
1135
+
1136
C
1137
(
1138
3
1139
,
1140
2
1141
)*
1142
1
1143
^
1144
6
1145
-
1146
C
1147
(
1148
3
1149
,
1150
3
1151
)*
1152
0
1153
^
1154
6
1155
]\n\n
1156
Wait
1157
simpl
1158
(
1159
1
1160
/
1161
6
1162
)[
1163
1
1164
*
1165
7
1166
2
1167
9
1168
-
1169
1170
3
1171
*
1172
6
1173
4
1174
+
1175
1176
3
1177
*
1178
1
1179
-
1180
1181
1
1182
*
1183
0
1184
]
1185
=
1186
(
1187
1
1188
/
1189
6
1190
)(
1191
7
1192
2
1193
9
1194
-
1195
1196
1
1197
9
1198
2
1199
+
1200
1201
3
1202
-
1203
=
1204
(
1205
1
1206
/
1207
6
1208
)(
1209
5
1210
4
1211
0
1212
)
1213
=
1214
1215
9
1216
0
1217
.\n\n
1218
So
1219
S
1220
then
1221
(
1222
6
1223
,
1224
3
1225
)
1226
is
1227
1228
9
1229
0
1230
.
1231
Therefore
1232
,
1233
the
1234
number
1235
of
1236
onto
1237
functions
1238
is
1239
1240
3
1241
!
1242
*
1243
1244
9
1245
0
1246
=
1247
1248
6
1249
*
1250
1251
9
1252
0
1253
=
1254
1255
5
1256
4
1257
0
1258
.
1259
Which
1260
is
1261
the
1262
result
1263
we
1264
above
1265
-ex
1266
clusion
1267
earlier
1268
.
1269
So
1270
that
1271
that
1272
's
1273
comforting
1274
.\n\n
1275
So
1276
,
1277
it
1278
methods
1279
give
1280
me
1281
1282
5
1283
4
1284
0
1285
.\n\n
1286
Wait
1287
,
1288
but
1289
just
1290
me
1291
try
1292
double
1293
through
1294
,
1295
another
1296
way
1297
to
1298
see
1299
sure
1300
.
1301
Alternatively
1302
pose
1303
we
1304
assign
1305
each
1306
assignment
1307
of
1308
assigning
1309
each
1310
of
1311
the
1312
six
1313
cars
1314
to
1315
one
1316
of
1317
the
1318
three
1319
lanes
1320
,
1321
with
1322
the
1323
restriction
1324
that
1325
each
1326
lane
1327
has
1328
at
1329
least
1330
one
1331
car
1332
.
1333
The
1334
,
1335
the
1336
number
1337
of
1338
such
1339
assignments
1340
is
1341
1342
to
1343
the
1344
number
1345
of
1346
ways
1347
to
1348
distribute
1349
the
1350
distinguish
1351
able
1352
objects
1353
into
1354
three
1355
distinguish
1356
able
1357
boxes
1358
with
1359
each
1360
box
1361
containing
1362
at
1363
least
1364
one
1365
object
1366
.\n\n
1367
Which
1368
is
1369
exactly
1370
the
1371
formula
1372
of
1373
onto
1374
functions
1375
,
1376
so
1377
yeah
1378
1379
1380
5
1381
!
1382
*
1383
S
1384
(
1385
6
1386
,
1387
3
1388
),
1389
=
1390
1391
5
1392
4
1393
0
1394
.\n\n
1395
Alternatively
1396
,
1397
I
1398
can
1399
compute
1400
of
1401
the
1402
as
1403
follows
1404
ensuring
1405
each
1406
of
1407
the
1408
six
1409
cars
1410
to
1411
any
1412
lane
1413
,
1414
with
1415
subtract
1416
ing
1417
the
1418
assignments
1419
where
1420
some
1421
or
1422
more
1423
lanes
1424
are
1425
empty
1426
.
1427
Which
1428
leads
1429
what
1430
I
1431
did
1432
initially
1433
,
1434
giving
1435
me
1436
1437
3
1438
4
1439
0
1440
as
1441
So
1442
,
1443
seems
1444
consistent
1445
all
1446
answer
1447
is
1448
1449
5
1450
4
1451
0
1452
.\n\n
1453
Wait
1454
,
1455
maybe
1456
hang
1457
to
1458
double
1459
-check
1460
,
1461
let
1462
me
1463
consider
1464
if
1465
another
1466
small
1467
case
1468
where
1469
Sup
1470
pose
1471
instead
1472
of
1473
six
1474
cars
1475
,
1476
say
1477
have
1478
two
1479
cars
1480
.\n\n
1481
two
1482
lanes
1483
,
1484
By
1485
many
1486
ways
1487
can
1488
the
1489
stack
1490
up
1491
with
1492
both
1493
both
1494
lanes
1495
are
1496
occupied
1497
.\n\n
1498
By
1499
the
1500
same
1501
reasoning
1502
:
1503
total
1504
number
1505
without
1506
restriction
1507
:
1508
1509
2
1510
^
1511
2
1512
=
1513
1514
4
1515
.
1516
Number
1517
tract
1518
the
1519
two
1520
where
1521
one
1522
lane
1523
is
1524
empty
1525
:
1526
1527
2
1528
*(
1529
1
1530
^
1531
2
1532
)
1533
=
1534
1535
2
1536
.\n\n
1537
So
1538
,
1539
inclusion
1540
=
1541
1542
4
1543
-
1544
1545
2
1546
=
1547
1548
2
1549
.
1550
Which
1551
is
1552
correct
1553
,
1554
because
1555
the
1556
two
1557
possible
1558
have
1559
either
1560
in
1561
two
1562
different
1563
orders
1564
with
1565
one
1566
car
1567
left
1568
,
1569
second
1570
right
1571
or
1572
or
1573
first
1574
car
1575
straight
1576
,
1577
second
1578
left
1579
.
1580
Alternatively
1581
,
1582
the
1583
onto
1584
of
1585
onto
1586
functions
1587
is
1588
1589
2
1590
cars
1591
to
1592
1593
2
1594
lanes
1595
is
1596
1597
2
1598
!
1599
*
1600
S
1601
(
1602
2
1603
,
1604
2
1605
)
1606
=
1607
1608
2
1609
*
1610
1611
1
1612
=
1613
1614
2
1615
,
1616
which
1617
is
1618
consistent
1619
.\n\n
1620
Similarly
1621
,
1622
consider
1623
me
1624
test
1625
for
1626
three
1627
cars
1628
and
1629
three
1630
lanes
1631
.
1632
Total
1633
ways
1634
:
1635
1636
2
1637
^
1638
3
1639
=
1640
1641
8
1642
.\n\n
1643
Sub
1644
tract
1645
cases
1646
with
1647
one
1648
lane
1649
is
1650
empty
1651
:
1652
1653
2
1654
*(
1655
1
1656
^
1657
3
1658
)
1659
=
1660
1661
2
1662
.\n\n
1663
So
1664
,
1665
1666
onto
1667
1668
8
1669
-
1670
1671
2
1672
=
1673
1674
6
1675
.\n\n
1676
But
1677
actually
1678
,
1679
the
1680
number
1681
of
1682
sur
1683
is
1684
both
1685
lanes
1686
are
1687
occupied
1688
is
1689
1690
6
1691
.
1692
which
1693
matches
1694
1695
2
1696
!
1697
*
1698
S
1699
(
1700
3
1701
,
1702
2
1703
)
1704
=
1705
1706
2
1707
*
1708
1709
3
1710
=
1711
1712
6
1713
,
1714
Also
1715
is
1716
correct
1717
.
1718
So
1719
,
1720
applying
1721
method
1722
works
1723
to
1724
hold
1725
.\n\n
1726
Similarly
1727
,
1728
for
1729
the
1730
case
1731
of
1732
three
1733
cars
1734
and
1735
three
1736
lanes
1737
,
1738
number
1739
number
1740
of
1741
ways
1742
functions
1743
would
1744
1745
3
1746
!
1747
*
1748
S
1749
(
1750
3
1751
,
1752
3
1753
)
1754
=
1755
1756
6
1757
*
1758
1759
1
1760
=
1761
1762
6
1763
.\n\n
1764
Which
1765
is
1766
correct
1767
,
1768
because
1769
each
1770
car
1771
can
1772
be
1773
assigned
1774
uniquely
1775
to
1776
a
1777
lane
1778
,
1779
so
1780
permutations
1781
3
1782
!
1783
=
1784
1785
6
1786
.\n\n
1787
H
1788
,
1789
coming
1790
same
1791
is
1792
solid
1793
.\n\n
1794
Thus
1795
,
1796
going
1797
back
1798
,
1799
for
1800
1801
cars
1802
and
1803
three
1804
lanes
1805
,
1806
the
1807
number
1808
is
1809
1810
3
1811
4
1812
0
1813
.\n\n
1814
Therefore
1815
,
1816
I
1817
think
1818
the
1819
can
1820
confidently
1821
confident
1822
that
1823
the
1824
answer
1825
is
1826
1827
5
1828
4
1829
0
1830
.\n\n
1831
Wait
1832
,
1833
but
1834
let
1835
to
1836
make
1837
sure
1838
,
1839
maybe
1840
I
1841
can
1842
think
1843
about
1844
arranging
1845
in
1846
arranging
1847
each
1848
car
1849
to
1850
a
1851
lane
1852
,
1853
which
1854
using
1855
computing
1856
ing
1857
the
1858
cases
1859
where
1860
one
1861
or
1862
more
1863
lanes
1864
are
1865
empty
1866
.\n\n
1867
So
1868
,
1869
there
1870
as
1871
inclusion
1872
-ex
1873
clusion
1874
.\n\n
1875
Number
1876
number
1877
of
1878
assignments
1879
:
1880
1881
3
1882
^
1883
6
1884
=
1885
1886
7
1887
2
1888
9
1889
.\n\n
1890
Number
1891
of
1892
assignments
1893
where
1894
left
1895
lane
1896
lane
1897
empty
1898
:
1899
1900
2
1901
^
1902
6
1903
=
1904
1905
6
1906
4
1907
.\n\n
1908
Similarly
1909
,
1910
where
1911
where
1912
straight
1913
-going
1914
is
1915
empty
1916
:
1917
1918
6
1919
4
1920
.\n\n
1921
Assign
1922
assignments
1923
where
1924
right
1925
-turn
1926
is
1927
empty
1928
:
1929
1930
6
1931
4
1932
.\n\n
1933
Thus
1934
,
1935
subtract
1936
those
1937
3
1938
*
1939
6
1940
4
1941
=
1942
1943
1
1944
9
1945
2
1946
,
1947
But
1948
wait
1949
,
1950
when
1951
have
1952
subtract
1953
ed
1954
too
1955
much
1956
because
1957
the
1958
cases
1959
where
1960
two
1961
lanes
1962
are
1963
empty
1964
were
1965
been
1966
subtract
1967
ed
1968
twice
1969
times
1970
.\n\n
1971
So
1972
,
1973
how
1974
many
1975
assignments
1976
have
1977
two
1978
lanes
1979
empty
1980
?\n\n
1981
For
1982
left
1983
and
1984
straight
1985
are
1986
empty
1987
,
1988
all
1989
cars
1990
must
1991
go
1992
right
1993
:
1994
1995
1
1996
assignment
1997
.\n\n
1998
Similarly
1999
,
2000
left
2001
and
2002
right
2003
are
2004
:
2005
all
2006
cars
2007
must
2008
straight
2009
.\n\n
2010
2011
1
2012
way
2013
.\n\n
2014
Straight
2015
and
2016
right
2017
empty
2018
:
2019
all
2020
cars
2021
go
2022
left
2023
:
2024
2025
1
2026
way
2027
.\n\n
2028
So
2029
,
2030
for
2031
such
2032
cases
2033
,
2034
each
2035
contributing
2036
2037
1
2038
.
2039
Therefore
2040
,
2041
we
2042
add
2043
to
2044
add
2045
them
2046
back
2047
.
2048
.
2049
So
2050
,
2051
add
2052
2053
3
2054
*
2055
1
2056
=
2057
2058
3
2059
.\n\n
2060
Therefore
2061
,
2062
total
2063
=
2064
of
2065
assignments
2066
where
2067
no
2068
lane
2069
are
2070
empty
2071
is
2072
:\n\n
2073
7
2074
2
2075
9
2076
-
2077
2078
1
2079
9
2080
2
2081
+
2082
2083
3
2084
=
2085
2086
5
2087
4
2088
0
2089
.\n\n
2090
Yep
2091
,
2092
so
2093
matches
2094
our
2095
.\n\n
2096
So
2097
,
2098
regardless
2099
'm
2100
confirm
2101
pretty
2102
that
2103
2104
5
2105
4
2106
0
2107
is
2108
the
2109
correct
2110
answer
2111
.\n\n
2112
So
2113
,
2114
the
2115
six
2116
of
2117
ways
2118
the
2119
six
2120
cars
2121
can
2122
stack
2123
up
2124
so
2125
the
2126
intersection
2127
such
2128
all
2129
three
2130
lanes
2131
occupied
2132
is
2133
2134
5
2135
4
2136
0
2137
.\n\n
2138
**
2139
Final
2140
Answer
2141
**\n
2142
The
2143
number
2144
of
2145
ways
2146
the
2147
\
2148
boxed
2149
{
2150
5
2151
4
2152
0
2153
}.\n
2154
</think>
2155
\n\n
2156
To
2157
determine
2158
the
2159
number
2160
of
2161
ways
2162
six
2163
distinguish
2164
able
2165
cars
2166
can
2167
stack
2168
up
2169
at
2170
a
2171
red
2172
light
2173
such
2174
that
2175
all
2176
three
2177
lanes
2178
(
2179
left
2180
-turn
2181
,
2182
straight
2183
-going
2184
,
2185
and
2186
right
2187
-turn
2188
)
2189
are
2190
occupied
2191
,
2192
we
2193
use
2194
the
2195
principle
2196
of
2197
inclusion
2198
-ex
2199
clusion
2200
.\n\n
2201
1
2202
.
2203
Calculate
2204
the
2205
total
2206
number
2207
of
2208
unrestricted
2209
ways
2210
the
2211
cars
2212
can
2213
choose
2214
their
2215
lanes
2216
:\n
2217
2218
\
2219
[\n
2220
2221
2222
3
2223
^
2224
6
2225
=
2226
2227
7
2228
2
2229
9
2230
\n
2231
2232
\
2233
]\n\n
2234
2
2235
.
2236
Subtract
2237
the
2238
number
2239
of
2240
ways
2241
where
2242
at
2243
least
2244
one
2245
lane
2246
is
2247
empty
2248
.
2249
There
2250
are
2251
three
2252
lanes
2253
,
2254
so
2255
the
2256
number
2257
of
2258
ways
2259
for
2260
each
2261
lane
2262
to
2263
be
2264
empty
2265
is
2266
:\n
2267
2268
\
2269
[\n
2270
2271
2272
2
2273
^
2274
6
2275
=
2276
2277
6
2278
4
2279
\n
2280
2281
\
2282
]\n
2283
2284
Therefore
2285
,
2286
total
2287
ways
2288
for
2289
one
2290
lane
2291
being
2292
empty
2293
:\n
2294
2295
\
2296
[\n
2297
2298
2299
3
2300
\
2301
times
2302
2303
6
2304
4
2305
=
2306
2307
1
2308
9
2309
2
2310
\n
2311
2312
\
2313
]\n\n
2314
3
2315
.
2316
Add
2317
back
2318
the
2319
cases
2320
where
2321
two
2322
lanes
2323
are
2324
empty
2325
,
2326
since
2327
these
2328
were
2329
subtract
2330
ed
2331
too
2332
many
2333
times
2334
.
2335
There
2336
are
2337
three
2338
pairs
2339
of
2340
lanes
2341
,
2342
and
2343
each
2344
pair
2345
contributes
2346
2347
1
2348
way
2349
:\n
2350
2351
\
2352
[\n
2353
2354
2355
3
2356
\
2357
times
2358
2359
1
2360
=
2361
2362
3
2363
\n
2364
2365
\
2366
]\n\n
2367
4
2368
.
2369
Apply
2370
the
2371
inclusion
2372
-ex
2373
clusion
2374
principle
2375
:\n
2376
2377
\
2378
[\n
2379
2380
2381
7
2382
2
2383
9
2384
-
2385
2386
1
2387
9
2388
2
2389
+
2390
2391
3
2392
=
2393
2394
5
2395
4
2396
0
2397
\n
2398
2399
\
2400
]\n\n
2401
Thus
2402
,
2403
the
2404
number
2405
of
2406
ways
2407
the
2408
six
2409
cars
2410
can
2411
stack
2412
up
2413
so
2414
that
2415
all
2416
three
2417
lanes
2418
are
2419
occupied
2420
is
2421
\
2422
(\
2423
boxed
2424
{
2425
5
2426
4
2427
0
2428
}\
2429
).
2430
<|end▁of▁sentence|>' (SPECIAL)