SP2877 SDGAME2 - Another understanding of Super Dice Game

Description

When we were trying to solve the problem SDGAME, we got a misunderstanding of it.We didn't get AC until we were told the original meaning.But we think our kind of understanding is also interesting and is worthy of doing.So enjoy the problem. Alice and Bob are playing a game. The game consists of a circular track of M (2

Input Format

The first line contains R, N, and M each separated by a space. R lines follow. Each line will contain d v a b separated by a space. d indicates the label of the dice rolled. v indicates the value shown on the dice. a and b indicate the range of dice used to determine the move distance.

Output Format

R lines containing the position of the player that just rolled after their roll.