Hi, are difficulty A problems based on pattern and maths, difficulty B based on dynamic programming? How difficulty of a program calculates?