1#include <bits/stdc++.h>
2#include <math.h>
3using namespace std;
4
5#define ll long long
6
7bool checkPrime(int number){
8 for(int i=2; i<=sqrt(number); i++){
9 if(number%i==0){
10 return false;
11 }
12 }
13 return true;
14}
1// 6k+-1 optimisation
2bool is_prime6(int num) {
3 int i;
4 if (num == 1)
5 return false;
6 if (num <= 3)
7 return true;
8 if (num % 2 == 0 || num % 3 == 0)
9 return false;
10 if (num < 25)
11 return true;
12 for (i = 5; i * i <= num; i += 6)
13 if (num % i == 0 || num % (i + 2) == 0)
14 return false;
15 return true;
16}
1bool isPrime(int s){
2 if(s<=1)return false;
3 if(s==2)return true;
4 int m = ceil(sqrt(s));
5 for(int i=2;i<=m;i++){
6 if(s%i==0){
7 return false;
8 }
9 }
10 return true;
11}
1#include <bits/stdc++.h>
2using namespace std;
3
4#define ll long long
5bool isPrime(ll number){
6 for(ll i = 2; i <= number / 2; i++){
7
8
9 if(number % i == 0)
10 {
11 return false;
12 break;
13 }
14 }
15
16 return true;
17}