I am trying to solve my rank that is close to 1100 +200 questions. I have tried 3 questions, but I'm stuck at something. Like in

https://codeforces.com/problemset/problem/1839/C . Here if last digit is 1 no solution exist. How can I come up with this. Also in this question https://codeforces.com/problemset/problem/1838/C . If we change the order of rows, we can achieve what the question is asking us. For previous question I used 1 hr to think of backtracking and that also i wasn't even to solve given my implementation sucks for complex topic like backtracking. Is there a way to improve my intuition. Do I need to solve more questions to get better at it?