Editorial -CFBDAY

Problem Link - Link

Author - Rishabh Verma
Editorialist - Rishabh Verma

Difficulty :- Easy

Problem -
You have given 3 numbers and problem says you have to add a number at least 1 so that the total sum is a PRIME NUMBER .

Explanation -
Simply make a function which check prime number and in main function run a while loop and take a sum variable and each time add 1 and check if sum is prime . Count how many time the while loop run and print the value of count .

My Solution -

#include <bits/stdc++.h>
using namespace std;
int prim(int n){
    for(int i=2;i<=sqrt(n);i++){
            return 0;
    }return 1;

int main() {
	int t; cin>>t;
	    int x,y,z; 
	    int ans= x+y+z+1;
	    int count=1;
	    int check=0;
	    while(check != 1){
	         check= prim(ans);
	         if(check) break;
	         else {
	         	ans +=1;
	return 0;