include
using namespace std;
main()
{
int i,t,j,count;
cin >> t;
int m[t];
int n[t];
for(i=0;i {
cin >> m[i] >> n[i];
}
for(i=0;i {
if(m[i]>=1 && m[i]<=n[i]&& n[i] <= 1000000000 && n[i]-m[i] <= 100000)
{
while(m[i]<=n[i])
{
count=0;
for(j=1;j<=m[i];j++)
if((m[i]%j)==0)
count++;
if(count==2)
{
cout << m[i] << '\n';
}
m[i]++;
}
}
cout << '\n';
}
return 0;
}
o/p:
2
1 10
1 100
2
3
5
7
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
73
79
83
89
97
Process returned 0 (0x0) execution time : 9.032 s
Press any key to continue.
stil timelimit is exceeding................
pls hlp me
created
last reply
- 1
reply
- 187
views
- 2
users