How to find no. of factors of a number in very efficient way.

1<=**T**<=10^{5}

1<=**N**<=10^{7}

Given a no. of test cases **T** and for each case there is one line of input which represents an integer **N**.

For each case output no. of factors of **N**.

**MY APPROACH**

This is my approach, I have pre-computed no. of factors for every no. But I feel this approach is slow. Can anyone suggest any modification or another approach.