import std.stdio; import std.conv; import std.string; import std.algorithm; import std.range; import std.array; // main ==================== void main(){ auto buf = readln.strip.split(" ").map!(to!int).array; auto shuffleNums = readln.strip.split(" ").map!(to!int).array; auto cards = iota(1, buf[0]+1).array; foreach(n; shuffleNums){ cards = cards[n-1] ~ cards[0..n-1] ~ cards[n..$]; } }