Let's Begin!
Practice
4 (32 votes)
Easy
Math
Open
Problem
68% Success 11851 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

February Easy Challenge 2015 is underway. Hackerearth welcomes you all and hope that all you awesome coders have a great time. So without wasting much of the time let's begin the contest.

Prime Numbers have always been one of the favourite topics for problem setters. For more information on them you can use see this link http://en.wikipedia.org/wiki/Prime_number .

Aishwarya is a mathematics student at the Department of Mathematics and Computing, California. Her teacher recently gave her an intriguing assignment with only a single question. The question was to find out the minimum number of single digit prime numbers which when summed equals a given number X.

Input:
The first line contains T denoting the number of test cases. Each of the next T lines contains a single integer X.

Output:
Print the minimum number required. If it is not possible to obtain X using single digit prime numbers, output -1.

Constraints:
1<=T<=100
1<=X<=10^6

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
26 votes
Tags:
AlgorithmsApprovedBinary SearchData StructuresDynamic ProgrammingMediumOpenopen
Points:20
29 votes
Tags:
Ad-HocApprovedEasyImplementationOpen
Points:20
30 votes
Tags:
AlgorithmsDynamic Programming