Решить на паскаль ABC
Код PascalABC 3.0: Var x,y:byte; input:text; Begin Assign(input,'input.txt'); Reset(input); ReadLn(input,x,y); Case y of 1,3,5,7,8,10,12:Write(31-x); 2:Write(28-x); 4,6,9,11:Write(30-x) End; Close(input) End.