rnumberProblem code: TECH02 |
In this problem your task is to reduce a given number 'N' to a non-positive number in as little moves as possible. The moves allowed are : Given an integer 'N' you can subtract one of its factors (excluding 'N' itself) from 'N' and continue the same process with the resulting number until you reach a non-positive number
Input
First line contains the number of test cases 'T'. 'T' lines follow containing a single integer 'N' 2<=N<100,000.
Output
A single integer denoting the minimum number of moves necessary.
Example
Input: 1 10 Output: 5
| Author: | technovanza10 |
| Date Added: | 12-01-2010 |
| Time Limit: | 102 sec |
| Source Limit: | 50000 Bytes |
| Languages: | C, C99 strict, CLOJ, CPP 4.0.0-8, CPP 4.3.2, F#, GO, JAVA, PERL6, PYTH 3.1.2, TEXT |
Comments

Fetching successful submissions

Note that there is a special
Note that there is a special case when N=1, you can substract '1' to reach 0.
What would be answer for 1 ?
What would be answer for 1 ? It must be infinity by definition.
Time limit for this problem
Time limit for this problem is 2s
wht is the ans for n=2 ,3
wht is the ans for n=2 ,3 ?
we need to subtract 1 and then again we obtain 1 what to do with that.?
algoCrack, Technovanza10 I
algoCrack, Technovanza10
I didnt register on codechef as algoCrack_{teamname} but have register on ur site as {teamname} , can i do some now now , if yes please tell me.....
i'm having 3rd place in ur
i'm having 3rd place in ur contest handle vish