Course Computational Mathematics
Sieve of Eratosthenes
In this lesson, we'll learn about the Sieve of Eratosthenes and some of its applications. We will solve the following base problem:
Given two numbers
As we saw in the previous lesson, we can answer whether
#include <iostream>
using namespace std;
int main()
{
int q, n;
cin >> q >> n;
for (int i = 0; i < q; i++)
{
int v;
cin >> v;