 use at the same time a <code>deque</code> and a <code>intset</code>
(<em>hey, I did not know there is a new <a href="https://nim-lang.github.io/Nim/packedsets.html"><code>packedset</code></a> that will generalize and replace
<code>intset</code></em>).</p>
<p>The second part was rather straightforward with two nested for loops.</p>
<p>I would say anyway the main technique here is a wise use of <code>break</code> statement,
especially using named blocks.</p>
<p>But first things first, parsing the input this 