A. Legs #
Hint
Greedily take Cow as long as you can.
Video Editorial
B. Scale #
Idea
Just print all index $A[i \cdot K][j \cdot K]$
Video Editorial
C. Sort #
Hint
Video Editorial
D. Fun #
Hint 1
Bruteforce works, now analyse why it works.
Hint 2
Video Editorial
E. Decode #
Easy version
Hint 1
Replace all 0 with -1. Now all segments with equal 0 and 1 have zero sum.
Hint 2
Instead of counting segments inside each range. For each substring with zero sum, count segments it is a part of.
Video Editorial
F. Bomb #
Hint 1
Greedy, always take the index with maximum value of $A-i$
Hint 2
Hint 3
Binary search on the value you will add in $k^{th}$ operation.
Video Editorial
G. Penacony #
Hint 1
Delete one road, now path between any pair of friends is unique. Try to count paths which do not lie between any pair of friends.
Hint 2
Given an array A, and multiple queries $L_i$ and $R_i$. Can you find the minimum value in this range, and how many times it appears?