As promised, here are some (nested) hints for Codeforces Round #682 (Div. 2).
1438A - Specific Tastes of Andre
Hint 1
1438B - Valerii Against Everyone
Hint 1
Hint 1
Hint 1
I wasn't able to solve E and F. If you did, you may want to add your hints in the comments.