CF455D Serega and Fun
Description
Serega loves fun. However, everyone has fun in the unique manner. Serega has fun by solving query problems. One day Fedor came up with such a problem.
You are given an array $ a $ consisting of $ n $ positive integers and queries to it. The queries can be of two types:
1. Make a unit cyclic shift to the right on the segment from $ l $ to $ r $ (both borders inclusive). That is rearrange elements of the array in the following manner: $ a[l],a[l+1],...,a[r-1],a[r]→a[r],a[l],a[l+1],...,a[r-1]. $
2. Count how many numbers equal to $ k $ are on the segment from $ l $ to $ r $ (both borders inclusive).
Fedor hurried to see Serega enjoy the problem and Serega solved it really quickly. Let's see, can you solve it?
Input Format
N/A
Output Format
N/A