import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;


void main() {
    auto firstline = readln.chomp.split.map!(to!int);
    int N = firstline[0];
    int M = firstline[1];
    int[] ans;
    ans.length = M;
    ans[] = 0;

    string line;
    while ((line = readln.chomp).length != 0)
    {
        auto chunks = line.split.map!(to!int);
        int l = chunks[0];
        int r = chunks[1];
        for (int d = 1; d <= r; d++)
        {
            int c = r%d==0 ? r/d+1 : cast(int)ceil(cast(double)r/d);
            int f = l%d==0 ? l/d-1 : cast(int)floor(cast(double)l/d);
            // writefln("%d %d / %d -> %d %d", l, r, d, f, c);
            if (c-f >= 2) ans[d-1]++;
        }
    }
    ans.each!writeln;   
}
