T512613 「QMSOI R1」 Distorted Fate 加强版

题目描述

同 「QMSOI R1」 Distorted Fate。

输入格式

本题**强制在线**。 在输入中,记上一次查询的答案为 $last\_ans$,初始时 $last\_ans=0$。 则真实输入中,$l'=(l \oplus last\_ans) \bmod n+1,r'=(r \oplus last\_ans) \bmod n+1$。 注意可能在解码后出现 $l'>r'$ 的情况,此时请将 $l'$ 和 $r'$ 互换。

输出格式

同 「QMSOI R1」 Distorted Fate。