#include <vector>
#include <map>

class BinaryIndexedTree
{
private:
    std::vector<int> vals;
    int n;
public:
    BinaryIndexedTree(int n_)
        : vals(n_, 0), n(n_) { }

    void add(int a, int w)
    {
        for (int x = a; x <= n; x += x & -x) {
            vals[x - 1] += w;
        }
    }

    int sum(int a) const
    {
        int ret = 0;
        for (int x = a; x > 0; x -= x & -x) {
            ret += vals[x - 1];
        }
        return ret;
    }
};

class SnLine
{
private:
    struct ProdRange
    {
        ProdRange() { l = r = 0; }
        ProdRange(int l_, int r_) { l = l_; r = r_; }
        int l, r;
    };

    static ProdRange makeProdRange(int l, int r)
    {
        return ProdRange { l, r };
    }

    std::map< int, std::vector<ProdRange> > prList;

    int numProds;
    int numStops;

public:
    SnLine(int numStops_)
    {
        numStops = numStops_;
        numProds = 0;
    }

    void addProdRange(int l, int r)
    {
        int d = r - l + 1;
        prList[d].emplace_back(l, r);
        ++numProds;
    }

    void solve()
    {
        BinaryIndexedTree bit(numStops);
        
        auto it = prList.begin();
        int numRemainingProds = numProds;

        for (int d = 1; d <= numStops; ++d)
        {
            int r = numRemainingProds;

            if (1 < d)
            {
                for (int a = d; a <= numStops; a += d)
                {
                    r += bit.sum(a);
                }
            }

            std::cout << r << std::endl;

            if (it != prList.end() && it->first == d)
            {
                for (const ProdRange& pr : it->second)
                {
                    bit.add(pr.l, 1);
                    bit.add(pr.r + 1, -1);
                }
                numRemainingProds -= static_cast<int>(it->second.size());
                ++it;
            }
        }
    }
};

void main()
{
    int N, M;
    std::cin >> N >> M;

    SnLine sl(M);

    for (int i = 0; i < N; ++i)
    {
        int l, r;
        std::cin >> l >> r;
        sl.addProdRange(l, r);
    }

    sl.solve();
}
