Code not being submitted

Code gets complied and sample test case passes. But nothing happens on submitting the code.
Submission shows ‘TLE’

The problem:
Prateek recently graduated from college. To celebrate, he went to a candy shop and bought all the candies. The total cost was a number upto which there are n prime numbers (starting from 2). Since Prateek wants to minimize his cost, he calls you to help him find the minimum amount that needs to be paid. Being a student of Prateek bhaiya it is now your job to help him out :slight_smile: