FIS Interview Question

Write pseudo code to solve this problem.