A — Elephant
It's optimal to do the biggest possible step every time. So the elephant should do several steps by distance 5 and one or zero step by smaller distance. Answer equals to
Solution Problem A
B — Summer Camp
This one is a simple brute force problem, we will construct our string with numbers. After construction, we just have to print the n-th element of the string.
Solution Problem B
C — Bear and Five Cards
You need sort the array and find the max of 2 occurrences and max of 3 occurrences from the array, then subtract the maximum with the total sum to get the minimum sum.
Solution Problem C
D — Opponents
You simply need to check if any row has 0 in it and find the largest consecutive such row.
Solution Problem D