I am facing problem writing code entire code of the problem. Although I know the logic of the given question but facing issue in writing whole body of code including input function. Could u help me with that pseudo code of taking input and declaring class?