game-of-divisors

Two players are playing the following game with a positive integer N. On his turn a player has to write down on paper some integer between 1 and N. But it's forbidden to write an integer which is a divisor of some number already written on paper. For example N = 8 and numbers already written are: 6, 4, 7. In this case the new integer can be only 5 or 8.

If a player can not write a new number on his turn then he loses. Given the integer N can you figure out who will win the game if we assume that both players play optimally?

Input

The first line contains T - the number of test cases.
The following T lines contain one integer N each for the following test case.

Output

For each test case output 1 or 2 on a separate line depending on the answer for this test case.

Constraints
1 ≤ T, N ≤ 30

SAMPLE INPUT
1
3

SAMPLE OUTPUT
1

Difficulty: MEDIUM
Tags: Game theory

Mathematics

Starter code:

Solutions:
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
for _ in range(eval(input())):
	z=int(input())
	print("1")



#!/usr/bin/env python

from sys import stdin, stderr

def main():
	TC = int(stdin.readline().strip())
	print('\n'.join(['1'] * TC))
	return 0

if __name__ == '__main__': main()


import math
for m in range(int(input())):
	N = int(input())
	print(int(math.ceil(N/2)-(N/2)+1))


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
for x in range(int(input())):
	print(1)
	


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
T = int(eval(input()))
for tc in range(T):
	x = int(eval(input()))
	print((1))


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
for x in range(int(input())):
	print(1)
	


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
t = eval(input())
a=[]

for i in range(t):

	n = eval(input())
	for k in range(n):
		f=0
		for j in a:
			if value.isdigit(j/k+1):
				f=0
				break
			else:
				f=1
				a.append(k+1)
	if len(a)%2==0:
		print("1")
	else:
		print("2")
		
			
		
	


import math

#This is my first ever python Code :) .I want to thank my father,my mother to give birth to such a talented kid

t=int(input())

for i in range(t):
	n=int(input())
	print('1')
	


import math

#This is my first ever python Code :) .I want to thank my father,my mother to give birth to such a talented kid

t=int(input())

for i in range(t):
	n=int(input())
	print('1')
	


divisors={}
def compute_divisors():
	global divisors
	for i in range(1,31):
		div = []
		for j in range(1,i):
			if i%j==0:
				div.append(j)
		divisors[i]=div

def numberCanBeWritten(num,written_numbers):
	for e in written_numbers:
		if num in divisors[e]:
			return False
	return True


def solve(written_numbers,numbers_available,turn):
	nturn = (turn+1)%2+1
	if numbers_available==[]:
		return nturn
	for num in numbers_available:
		nwnum = written_numbers
		nnumavail = numbers_available
		if numberCanBeWritten(num,written_numbers):
			for e in divisors[num]:
				nnumavail.remove(e)
			nwnum.append(num)
			if solve(nwnum,nnumavail,nturn) == turn:
				return turn
	return nturn

compute_divisors()
#print divisors
t=input()
for i in range(int(t)):
	n=int(input())
	print(1)


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
test = eval(input())
for x in range(0,test):
	n = eval(input())
	print(1)