Sam and numbers

Problem Name:
Sam and numbers
Site:HackerEarth
Links:
Tags:
Problem setters: