## Primes... again

Given two integers N and M (N ≤ M), output all the prime numbers between N and M inclusive, one per line.

N and M will be positive integers less than or equal to 1,000,000,000.
The difference between N and M will be less than or equal to 5,000,000.

`5 20`

### Sample Output

```5
7
11
13
17
19```

Point Value: 15 (partial)
Time Limit: 5.00s
Memory Limit: 32M

Problem Types: [Show]

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

• (2/2)
the program isnt that hard if you really think about it so stop complaining.

• (1/1)
then why do you only have 3/20...

• (0/1)
is there a way to make arrays 1 trillion size o.0?

• (0/0)
The memory limit on this problem is 16 MB, which is around 4 million ints, 8 million shorts, or 16 million chars/bools. Standard compilers won't let you declare arrays larger than about 2 GB, but you don't get that much memory anyways.

• (1/1)
i wonder who scott...i wonder who...

• (2/2)
BTW, I submitted 15 times, and 10 of those times were just me being stupid, and finding out the test data.

I sumbitted A+B(2) like 40 times -_-

• (0/2)
What is this??? Only 20 points for this problem, that's unbelievable. Only 2 out of 162 submissions were correct. TWO OUT OF 165!!! Which were Jacob and Hanson anyways. That's ridiculous, they each have over 3000 points (this tells you just how good they are) and for a problem only they can solve, you get 20 points. Come on! Why would anyone do this problem when they can do 4 five pointers in one tenth the time (and at least youd get the 5 pointers right). I'm just saying, the point system is messed, these harder problems deserve a lot more points because 1. They take 10 times as long, and 2. Only a few can even hope of finishing them.

• (1/1)
YOU TELL EM ANDREW!! from the land of the bernesh

• (3/1)
who cares, just forget the points for a moment and think of the learning experience you go through to solve this problem (or when you get some help on it :P). anyhow, Hanson, Jacob and co. need much higher scores than us in comp sci, so they should be getting points from as many sources as possible (and doing these problems over and over again is what keeps their brains thinking).

• (2/1)
Although this problem is an exception, the point system is quite valid.

The more you are used to a certain level, the easier it is to do the questions of that level.
I know people who thought they are only capable of doing 3pt questions, the 5pt questions were hard and would take a long long time. They thought it was rigged but after a while, they did more and more 5pts and they got used to it. Now as they think back, the 5pt, weren't so hard after all. Same applies for 10pt. Same applies to this.

• (0/0)
that the last test case (which i'm TLEing on) is

995 000 000
1 000 000 000

• (0/0)
How many points are you willing to bet?

• (1/0)
in that case, i win and lose, so the net gain would be 0.

• (0/0)
The last test case is not quite what you stated.

• (0/0)
is needed if you want 5 more points for this problem.

:P