-
Notifications
You must be signed in to change notification settings - Fork 2
stararrangements
bradendubois edited this page Sep 9, 2021
·
7 revisions
ID: stararrangements
Difficulty: 1.6
CPU Time: 1 second
Memory: 1024 MB
There are 3 layouts to consider for a flag: ABABA..., ABAB..., AAA..., and so one can iterate from i=2 to S/2 + 1 (the valid ranges for A to be based on how the star pattern may exist), and for the first case, A = i, B = i-1, and if S % (A + B) = A, it is the first case, = 0 is the second, and if S % A = 0, it is the third.