# Help me in solving FIZZBUZZ2305 problem

### My issue

Do I need to use loop for this problem?

``````

``````

Problem Link: FIZZBUZZ2305 Problem - CodeChef

yes

@mahia05
Loop is only for test case .
plzz refer my c++ code for better understanding of the logic.

``````#include <bits/stdc++.h>
using namespace std;

int main() {
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
if(n==1||n%2==0)
cout<<"Bob";
else
cout<<"Alice";
cout<<endl;
}
return 0;
}``````
1 Like

From the question what is understand is

``````def prime_factors(number):
i = 2
factors = []
while i * i <= number:
if number % i:
i += 1
else:
number //= i
factors.append(i)
if number > 1:
factors.append(number)
return factors

number_of_test_case = int(input())
for _ in range(number_of_test_case):
number = int(input())
flag = 0
while(number > 1):
factors = prime_factors(number)
status = 0
for i in factors:
if(i%2 != 0):
number = number - i
if(flag == 0):
flag = 1
else:
flag = 0
status = 1
break
if(status != 1):
break
if(flag == 0):
print("Bob")
else:
print("Alice")
``````

This code will run but can’t able submit due to time limit excide.