Problem:


Structured Programming

In programming languages like C/C++, a goto statement provides an unconditional jump from the "goto" to a labeled statement. For example, a statement "goto CHECK_NUM;" is executed, control of the program jumps to CHECK_NUM. Using these constructs, you can implement, for example, loops.

Note that use of goto statement is highly discouraged, because it is difficult to trace the control flow of a program which includes goto.

Write a program which does precisely the same thing as the following program (this example is wrtten in C++). Let's try to write the program without goto statements.

void call(int n){
  int i = 1;
 CHECK_NUM:
  int x = i;
  if ( x % 3 == 0 ){
    cout n is given in a line.

Output

Print the output result of the above program for given integer n.

Constraints

3 ≤ n ≤ 10000

Sample Input

30

Sample Output

 3 6 9 12 13 15 18 21 23 24 27 30

  Put a single space character before each element.



Sample input:
30


Sample output:
 3 6 9 12 13 15 18 21 23 24 27 30

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
a = ''
while i <= n:
    x = i
    if x % 3 == 0:
        a += ' ' + str(i)
    elif x % 10 == 3:
        a += ' ' + str(i)
    x /= 10
    while x:
        if x % 10 == 3:
            a += ' ' + str(i)
        x /= 10
    i += 1
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
a = ''
while i <= n:
    x = i
    if x % 3 == 0:
        a += ' ' + str(i)
    elif x % 10 == 3:
        a += ' ' + str(i)
    elif int(x/10) == 3:
        a += ' ' + str(i)
    i += 1
print(a)

Submission status: Wrong Answer

Solution code:
num = int(input())
for i in range(num):
    i += 1
    if i%3==0 or i%10==3:
        print(' {}'.format(i),end='')
print()

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
def multiple_3(num):
    if num % 3 == 0:
        print(" {}".format(num), end="")
    else:
        included_3(num)

def included_3(num):
    if num % 10 ==3:
        print(" {}".format(num), end="")
        
n = int(input())
for num in range(3, n+1):
    multiple_3(num)
print()

Submission status: Wrong Answer

Solution code:
def Check_Num(n):

    for i in range(1,n + 1):
        x = i
        if (x % 3 == 0):
            print(' {}'.format(i),end = '')
            continue
        elif (x % 10 == 3):
            print(' {}'.format(i),end = '')
            continue
        x //= 10
        while (x > 0):
            if (x % 10 == 3):
                print(' {}'.format(i),end = '')
            x //= 10
    print()

if __name__ == '__main__':
    n = int(input())
    Check_Num(n)

Submission status: Wrong Answer

Solution code:
def Check_Num(n):

    for i in range(1,n + 1):
        x = i
        if (x % 3 == 0):
            print(' {}'.format(i),end = '')
            continue
        elif (x % 10 == 3):
            print(' {}'.format(i),end = '')
            continue
        x //= 10
        while (x > 0):
            if (x % 10 == 3):
                print(' {}'.format(i),end = '')
            x //= 10

if __name__ == '__main__':
    n = int(input())
    Check_Num(n)
    print()

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = ''
i = 1
while i <= n:
    x = i
    if (x % 3) == 0:
        ans += ' ' + str(i)
        i += 1
    elif (x % 10) == 3:
        ans += ' ' + str(i)
        i += 1
    else:
        while True:
            x = (x // 10)
            if (x % 10) == 3:
                ans += ' ' + str(i)
            else:
                i += 1
                break
print(ans)

Submission status: Wrong Answer

Solution code:
n = input()
n = int(n)

for i in range(1, n+1):
    if (i % 3 == 0) or (i % 10 == 3):
        print(" " + str(i), end="")

print("")

Submission status: Wrong Answer

Solution code:
n = input()
n = int(n)
l = []

for i in range(1, n+1):
    if i % 3 == 0:
        l.append(i)
    else:
        j = i
        while j > 10:
            if j % 10 == 3:
                l.append(i)
                break
            else:
                j //= 10

for p in l:
    print(" " + str(p), end="")
print()

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(1, n+1):
	if i % 3 == 0 or i % 10 == 3:
		print(" " + str(i), end="")
print("")

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(1, n+1):
	if i % 3 == 0 or i % 10 == 3:
		print(" " + str(i), end="")

print("")

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(1, n+1):
	if i % 3 == 0 or i % 10 == 3 or int(i / 10) == 3:
		print(" " + str(i), end="")

print("")

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(3, n + 1):
  if i % 3 == 0 or i % 10 == 3:
    print(" %d" % i, end = "")
print("")

Submission status: Wrong Answer

Solution code:
n = int(input())
for x in range(3, n+1, 3):
    print(x, end=' ')

Submission status: Wrong Answer

Solution code:
n = int(input())
num_list = [i for i in range(1,n+1)]
num2_list = [i for i in num_list if i%3==0]
in3 = [i for i in num_list if i%10==3]
list_uniq = list(set(num2_list+in3))
list_uniq.sort()
print(' '+' '.join(str(i) for i in list_uniq))

Submission status: Wrong Answer

Solution code:
n = int(input())
num_list = [i for i in range(1,n+1)]
num2_list = [i for i in num_list if i%3==0]
in3 = [i for i in num_list if i%10==3]#10で割ったあまりが3
in3_2 = [i for i in num_list if int(i/10)==3]
list_uniq = list(set(num2_list+in3 + in3_2))
list_uniq.sort()
print(' '+' '.join(str(i) for i in list_uniq))

Submission status: Wrong Answer

Solution code:
n = int(input())
num_list = [i for i in range(1,n+1)]
num2_list = [i for i in num_list if i%3==0]#3で割り切れる値
in3 = [i for i in num_list if i%10==3]#10で割ったあまりが3
in3_2 = [i for i in num_list if int(i/10)==3 or int(i%100/10)==3 or int(i%1000/10) == 3]
list_uniq = list(set(num2_list+in3 + in3_2))
list_uniq.sort()
print(' '+' '.join(str(i) for i in list_uniq))

Submission status: Wrong Answer

Solution code:
n = int(input())
num_list = [i for i in range(1,n+1)]
num2_list = [i for i in num_list if i%3==0]#3で割り切れる値
in3 = [i for i in num_list if i%10==3]#10で割ったあまりが3
in3_2 = [i for i in num_list if int(i/10)==3 or int(i%10/10)==3 or int(i%100/10)==3 or int(i%1000/10) == 3]
list_uniq = list(set(num2_list+in3 + in3_2))
list_uniq.sort()
print(' '+' '.join(str(i) for i in list_uniq))

Submission status: Wrong Answer

Solution code:
n = int(input())
num_list = [i for i in range(1,n+1)]
num2_list = [i for i in num_list if i%3==0]#3で割り切れる値
in3 = [i for i in num_list if i%10==3]#10で割ったあまりが3
in3_2 = [i for i in num_list if int(i/10)==3 or int(i/100)==3 or int(i/1000)==3 or int(i/10000)==3 or int(i%100/10)==3 or int(i%1000/10) == 3]
list_uniq = list(set(num2_list+in3 + in3_2))
list_uniq.sort()
print(' '+' '.join(str(i) for i in list_uniq))

Submission status: Wrong Answer

Solution code:
n = int(input())
num_list = [i for i in range(1,n+1)]
num2_list = [i for i in num_list if i%3==0]#3で割り切れる値
in3 = [i for i in num_list if i%10==3]#10で割ったあまりが3
in3_2 = [i for i in num_list if int(i/10)==3 or int(i/100)==3 or int(i/1000)==3 or int(i/10000)==3 or int(i%100/10)==3 or int(i%1000/10) == 3 or int(i%10000/10) == 3]
list_uniq = list(set(num2_list+in3 + in3_2))
list_uniq.sort()
print(' '+' '.join(str(i) for i in list_uniq))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

n = int(input())
i = 1

while True:
    if i % 3 == 0 | i % 10 == 3:
        print(' {0}'.format(i))

    i += 1
    if i > n:
        break

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

n = int(input())
i = 1

while True:
    if i % 3 == 0 or i % 10 == 3:
        print(' {0}'.format(i), end='')

    i += 1
    if i > n:
        print()
        break

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

n = int(input())
i = 1

while True:
    if i % 3 == 0 or i % 10 == 3:
        print(' {0}'.format(i), end='')

    elif i // 10 is not 0 and (i // 10) % 3 == 0 :
        print(' {0}'.format(i), end='')



    i += 1
    if i > n:
        print()
        break

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

n = int(input())
i = 1

while True:
    if i % 3 == 0 or i % 10 == 3:
        print(' {0}'.format(i), end='')

    elif i // 10 is not 0 and (i // 10) % 10 == 0 :
        print(' {0}'.format(i), end='')

    i += 1
    if i > n:
        print()
        break

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

n = int(input())
i = 1

while True:
    if i % 3 == 0 or i % 10 == 3:
        print(' {0}'.format(i), end='')

    elif i // 10 is not 0 and (i // 10) % 10 == 3:
        print(' {0}'.format(i), end='')

    i += 1
    if i > n:
        print()
        break

Submission status: Wrong Answer

Solution code:
num = int(input())
targetNumList = []
for i in range(3, num + 1):
    if i % 3 == 0:
        targetNumList.append(i)
    elif i % 10 == 3:
        targetNumList.append(i)

print(' ', end='' )
print(*targetNumList)

Submission status: Wrong Answer

Solution code:
num = int(input().rstrip())

for i in range(1,num+1):
    if i % 3 == 0 or '3' in str(i):
        print(i)

Submission status: Wrong Answer

Solution code:
def include3(n):
	cond = 0
	while True:
		if n%10==3:
			cond = 1
			return cond
		elif n>9:
			n /= 10
		else:
			return cond

n = int(input())
for i in range(1,n+1):
	if i%3==0 or include3(i)==1:
		print(' ',end='')
		print(i,end='')
print()

Submission status: Wrong Answer

Solution code:
def check(num):
    n = str(num)
    for i in range(len(n)):
        if n[i] == '3': return True
    return False

n = int(input())
print('3', end = '')
for i in range(4, n):
    if i % 3 == 0: print(' ' + str(i), end = '')
    elif check(i):
        print(' ' + str(i), end = '')

Submission status: Wrong Answer

Solution code:
#! python3
# structured_programming.py

n = int(input())

for i in range(1, n+1):
    if i%3 == 0:
        print(' ' + str(i), end='')
    elif i%10 == 3:
        print(' ' + str(i), end='')
print('')

Submission status: Wrong Answer

Solution code:
#x = [int(i) for i in input().split()]
n = int(input())
for i in range(1, n+1):
    if i % 3 == 0:
        print(" ",i,sep="",end="")
    if i % 3 != 0 and i % 10 == 3:
        print(" ",i,sep="",end="")
print("")

Submission status: Wrong Answer

Solution code:
n = input()

n = int(n)

for i in range(1, n+1):
  if i%3 == 0:
    print(i)
  elif '3' in str(i):
    print(i)

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(n+1):
    if i%3==0:
        print(' '+str(i),end='')
    elif i%10==3:
        print(' '+str(i),end='')

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=''
for i in range(3,n+1):
    if i%3==0 or i%10==3:
        ans+=' '+str(i)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(1,n):
    if i%3==0:
        print(i,end=" ")
    elif str(i).find("3")>-1:
        print(i,end=" ")

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(1,n):
    if i%3==0:
        print(" ",end="")
        print(i,end="")
    elif str(i).find("3")>-1:
        print(" ",end="")
        print(i,end="")

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in range(1,n):
    if i%3==0:
        print(" ",end="")
        print(i,end="")
    elif str(i).find("3")>-1:
        print(" ",end="")
        print(i,end="")
print()

Submission status: Wrong Answer

Solution code:
def is_correct(i):
    if i % 3 == 0: return True
    while i > 0:
        if i % 10 == 3: return True
        i = i // 10
    return False

def main():
    n = int(input())
    for i in range(1, n + 1):
        if is_correct(i): print(' %d' % i)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

def three(n):
    result = [" ", 3]
    while result[-1] < n:
        result.append(result[-1] + 3)
    result = map(str, result)
    result = " ".join(result)
    return(result)


print(three(n))

Submission status: Wrong Answer

Solution code:
n = int(input())

def three(n):
    result = [3]
    while result[-1] < n:
        result.append(result[-1] + 3)
    result = map(str, result)
    result = " ".join(result)
    result = " " + result
    return(result)


print(three(n))

Submission status: Wrong Answer

Solution code:
def divisible(n):
    if n % 3 == 0:
        print(' {0}'.format(n), end='')


def remainder(n):
    if n % 10 == 3:
        print(' {0}'.format(n), end='')


n = int(input())
for n in range(3, n+1):
    divisible(n)
    if n % 3:
        remainder(n)
print()

Submission status: Wrong Answer

Solution code:
n=int(input())
c=1
while c <=n:
  if c%3==0:
    print(c)
  elif c%10==3:
    print(c)
  c +=1

Submission status: Wrong Answer

Solution code:
n=int(input())
c=1
print("")
while c <=n:
  if c%3==0 or c%10==3:
    print(c)
  c +=1

Submission status: Wrong Answer

Solution code:
n=int(input())
c=1
while c <=n:
  if c%3==0 or c%10==3:
    print(c)
  c +=1
print()

Submission status: Wrong Answer

Solution code:
n=int(input())
d=[]
for i in range(1,n+1):
    if i%3==0 or i%10==3:
        d.append(i)
print(" ",end="")
print(*d)

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(3, n+1):
    if i % 3 == 0 or i % 10 == 3:
        print(" {0}".format(i), end="")

print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n+1):
    if i%3 == 0 or i%10 == 3: print("", i, end="")
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n+1):
    if i%3 == 0 or i%10 == 3 or i//10 == 3: print("", i, end="")
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1, n+1):
    if i % 3 == 0:
        print(f' {i}', end='')
    elif i % 10 == 3:
        print(f' {i}', end='')
print()

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())

for i in range(3, n + 1):
	if i % 3 == 0 or i % 10 == 3:
		sys.stdout.write(' ')
		sys.stdout.write(str(i))
print()

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())

for i in range(3, n + 1):
	x = i
	if x % 3 == 0 or x % 10 == 3 or int(x / 10) % 10 == 3:
		sys.stdout.write(' ')
		sys.stdout.write(str(i))
print()

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())

for i in range(3, n + 1):
	x = i
	if x % 3 == 0 or x % 10 == 3:
		sys.stdout.write(' ')
		sys.stdout.write(str(i))
	else:
		while x != 0:
			x = int(x / 10)
			if x % 10 == 3:
				sys.stdout.write(' ')
				sys.stdout.write(str(i))
print()

Submission status: Wrong Answer

Solution code:
number = int(input(""))
for i in range (3,number+1):
    if(i==3):
        print(3,end="")
    elif(i%3==0):
        print(" "+str(i),end="")

Submission status: Wrong Answer

Solution code:
number = int(input(""))
for i in range (3,number+1):
    if(i==3):
        print(3,end="")
    elif(i%3==0):
        print(" "+str(i),end="")
print()

Submission status: Wrong Answer

Solution code:
import sys
for number in sys.stdin:
    number = int(number)
    for i in range (3,number+1):
        if(i==3):
            print(3,end="")
        elif(i%3==0):
            print(" "+str(i),end="")
    print()

Submission status: Wrong Answer

Solution code:
import sys
for number in sys.stdin:
    number = int(number)
    for i in range (3,number+1):
        if(i==3):
            print(3,end="")
        elif(i%3==0):
            print(" "+str(i),end="")

Submission status: Wrong Answer

Solution code:
n = int(input())

ans_str = " 3"
for i in range(4, n+1):
    if (i % 3) == 0:
        ans_str += " " + str(i)
    if (i % 10) == 3:
        ans_str += " " + str(i)

print(ans_str)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans_str = " 3"
for i in range(4, n+1):
    if (i % 3) == 0:
        ans_str += " " + str(i)
    elif (i % 10) == 3:
        ans_str += " " + str(i)
    elif (i // 30) == 1:
        ans_str += " " + str(i)

print(ans_str)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans_str = " 3"
for i in range(4, n+1):
    if (i % 3) == 0:
        ans_str += " " + str(i)
    elif (i % 10) == 3:
        ans_str += " " + str(i)
    elif (i // 10) == 3:
        ans_str += " " + str(i)

print(ans_str)

Submission status: Wrong Answer

Solution code:
i = int(input())
for n in range(1,i+1):
    if (n%3==0):
        print(' {}'.format(n))
    elif(n%10 == 3):
        print(' {}'.format(n))

Submission status: Wrong Answer

Solution code:
i = int(input())
for n in range(1,i+1):
    if (n%3==0):
        print(' {}'.format(n))
    elif(n%10 == 3):
        print(' {}'.format(n))
print()

Submission status: Wrong Answer

Solution code:
i = int(input())
for n in range(1,i+1):
    if (n%3==0):
        print(' {}'.format(n),end='') # 개행하면 안되기 때문
    elif(n%10 == 3):
        print(' {}'.format(n),end ='')
print()

Submission status: Wrong Answer

Solution code:
i = int(input())
for n in range(1,i+1):
    if (n%3==0):
        print(' {}'.format(n),end='') # 개행하면 안되기 때문
    else:
        x = i
        while x:
            print(' {}'.format(x),end='')
            x //= 10
            break
print()

Submission status: Wrong Answer

Solution code:
i = int(input())
for n in range(1,i+1):
    if (n%3==0):
        print(' {}'.format(n),end="") # 개행하면 안되기 때문
    elif(n%10==3):
        print(' {}'.format(i),end="")

print()

Submission status: Wrong Answer

Solution code:
i = int(input())
for n in range(1,i+1):
    if (n%3==0):
        print(' {}'.format(n),end="") # 개행하면 안되기 때문
    elif(n%10==3):
        print(' {}'.format(n),end="")
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n+1):
	if i > n:
		break
	if i % 3 == 0:
		print(" ", i, end="")
	else:
		if i % 10 ==3:
			print(" ", i, end="")

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1 , n+1):
	if i > n:
		break
	if i % 3 == 0:
		print(" {}".format(i), end="")
	else:
		if i % 10 == 3:
			print(" {}".format(i), end="")
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1 , n+1):
	if i > n:
		break
	if i % 3 == 0:
		print(" {}".format(i), end="")
	else:
		if {i % 10 == 3}:
			print(" {}".format(i), end="")
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1 , n+1):
	if i > n:
		break
	if i % 3 == 0:
		print(" {}".format(i), end="")
	else:
		if (i % 10 == 3):
			print(" {}".format(i), end="")
print()

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1 , n):
	if i % 3 == 0:
		print(" {}".format(i), end="")
	else:
		if i % 10 == 3:
			print(" {}".format(i), end="")
if n % 3 == 0:
	print(" {}".format(n))
else:
	if n % 10 ==3:
		print(" {}".format(n))

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(1 , n+1):
	if i % 3 == 0:
		print(" {}".format(i), end="")
	else:
		x = i
		if x % 10 == 3:
			print(" {}".format(x), end="")
print()

Submission status: Wrong Answer

Solution code:
def main():
    x = int(input())
    output = []
    for i in range(1,x+1):
        if i % 3 == 0 or i % 10 == 3:
            output.append(str(i))
    print(" "+" ".join(output))
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    x = int(input())
    output = []
    for i in range(1,x+1):
        if i % 3 == 0 or i % 10 == 3 or i //10 == 3:
            output.append(str(i))
    print(" "+" ".join(output))
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    x = int(input())
    output = []
    for i in range(1,x+1):
        if i % 3 == 0 or i % 10 == 3 or i // 10 == 3:
            print(" "+str(i), sep=' ', end="")
    print()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    x = int(input())
    output = []
    for i in range(1,x+1):
        if i % 3 == 0 or i % 10 == 3 or (i // 10) % 10 == 3:
            print(" "+str(i), sep=' ', end="")
    print()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
def main():
    x = int(input())
    data_size = int (math.log10(x) + 1)
    for i in range(1,x + 1):
        for j in range(data_size):
            if i % 3 == 0 or i % 10 == 3 or i // 10**j == 3:
                print(" "+str(i), sep=' ', end="")
                break
    print()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
def main():
    x = int(input())
    data_size = int (math.log10(x) + 1)
    print(data_size)
    for i in range(1,x + 1):
        for j in range(data_size):
            if i % 3 == 0 or i // 10**j == 3:
                print(" "+str(i), sep=' ', end="")
                break
    print()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
def main():
    x = int(input())
    data_size = int (math.log10(x) + 1)
    for i in range(1,x + 1):
        for j in range(data_size):
            if i % 3 == 0 or i // 10**j == 3:
                print(" "+str(i), sep=' ', end="")
                break
    print()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
def main():
    x = int(input())
    data_size = int (math.log10(x) + 1)
    print(data_size)
    for i in range(1,x + 1):
        for j in range(data_size):
            if i % 3 == 0 or i // 10**j == 3 or i % 10**j == 3:
                print(" "+str(i), sep=' ', end="")
                break
    print()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
def main():
    x = int(input())
    data_size = int (math.log10(x) + 1)
    for i in range(1,x + 1):
        for j in range(data_size):
            if i % 3 == 0 or i // 10**j == 3 or i % 10**j == 3:
                print(" "+str(i), sep=' ', end="")
                break
    print()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin

n = int(stdin.readline())

for i in range(1,n+1):
    x = i
    if x % 3 == 0 or x % 10 == 3:
        print('', i, end='')
        continue

    x //= 10
    while x != 0:
        if x % 10 == 3:
            print('', i, end='')

        x //= 10
print()

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
for i in range(1, a+1):
    while True:
        if(i < 100):
            break
    if(i % 3 == 0 or i % 10 == 3 or i // 10 == 3):
        print(" %d"%i, end = "")
print()

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
for i in range(1, a+1):
    x = i
    while True:
        if(x < 100):
            break
    if(x % 3 == 0 or x % 10 == 3 or x // 10 == 3):
        print(" %d"%x, end = "")
print()

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
for i in range(1, a+1):
    x = i
    if(x % 3 == 0):
        print(" %d"%x, end = "")
    else:
        while True:
            if(x % 10 == 3):
                print(" %d"%x, end = "")
            elif(x > 10):
                x //= 10
            else:
                break
        
        
print()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1

while True:
    x = i
    if  x % 3 == 0 or x % 10 ==3 or x/10 == 0:
        print(" %d" %i)
        i+=1
        if i > n:
            print()
            break

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1

while True:
    x = i
    if  x % 3 == 0 or x % 10 ==3 or x / 10 == 0:
        print(" " + i)
        i+=1
        if i > n:
            print()
            break

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1

while True:
    x = i
    if  x % 3 == 0:
        print(" %d" ,i)
        i+=1
        if i > n:
            print()
            break
    if x % 10 == 3:
        print(" %d" ,i)
        i+=1
        if i > n:
            print()
            break
    else:
        x /= 10
        if x != 0:
            continue

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1

while True:
    x = i
    if  x % 3 == 0:
        print(" %d" ,i)
        i+=1
        if i > n:
            print()
            break
    if x % 10 == 3:
        print(" %d" ,i)
        i+=1
        if i > n:
            print()
            break
    else:
        x /= 10
        if x != 0:
            if x % 10 == 3:
                print(" %d" ,i)
                i+=1
                if i > n:
                    print()
                    break

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1

while True:
    x = i
    if  x % 3 == 0:
        print(" %d" , i, end="")
        i+=1
        if i > n:
            print()
            break
    if x % 10 == 3:
        print(" %d" ,i, end="")
        i+=1
        if i > n:
            print()
            break
    else:
        x /= 10
        if x != 0:
            if x % 10 == 3:
                print(" %d" ,i,  end="")
                i+=1
                if i > n:
                    print()
                    break

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1

while True:
    x = i
    if  x % 3 == 0:
        print(" %d" , i, end="")
        i+=1
        if i > n:
            print()
            break

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret == " " + str(i)
        i+=1
        if i > n:
            print(ret)
            break
    if x % 10 == 3:
        ret == " " + str(i)
        i+=1
        if i > n:
            print(ret)
            break
    else:
        x /= 10
        if x != 0:
            if x % 10 == 3:
                ret == " " + str(i)
                i+=1
                if i > n:
                    print(ret)
                    break

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret = " " + str(i)
        i+=1
        if i > n:
            print(ret)
            break
    if x % 10 == 3:
        ret = " " + str(i)
        i+=1
        if i > n:
            print(ret)
            break
    else:
        x /= 10
        if x != 0:
            if x % 10 == 3:
                ret = " " + str(i)
                i+=1
                if i > n:
                    print(ret)
                    break

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret = " " + str(i)
        i+=1
        if i > n:
            print(ret)
            break

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret += " " + str(i)
        i+=1
        if i > n:
            print(ret)
            break

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret += " " + str(i)
    elif x % 10 == 3:
        ret += " " + str(i)
    else:
        x /= 10
        while x > 0:
            if x % 10 == 3:
                ret += " " + str(i)
                x /= 10
    i+=1
    if i > n:
        break

print(ret)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret += " " + str(i)
    elif x % 10 == 3:
        ret += " " + str(i)
    else:
        x /= 10
        while x > 0:
            if x % 10 == 3:
                ret += " " + str(i)
                x /= 10
                if x == 0:
                    break
    i+=1
    if i > n:
        break

print(ret)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
x = 0
for i in range(1, n+1):
  if i%3 == 0:
    print(' %d'%i, end="")
  else:
    x = i
while(x):
  if x%10 == 3:
    print(' %d'%i, end="")
    break
    x //= 10
print()

Submission status: Time Limit Exceeded

Solution code:
inp = int(input())

def check(n):
    i = 1
    print(" ",end="")
    while(i != n):
        if  (i % 3 == 0):
            print(i,end="")
        elif(i % 10 == 3):
            print(i,end="")
            i = i / 10

check(inp)

Submission status: Time Limit Exceeded

Solution code:
inp = int(input())

def check(n):
    i = 1
    print(" ",end="")
    while(i != n):
        if  (i % 3 == 0):
            print(i,end="")
        elif(i % 10 == 3):
            print(i,end="")
            i = i / 10
        i = i + 1
        

check(inp)

Submission status: Time Limit Exceeded

Solution code:
n = input()
array = []
x = 1
while x <= n:
    if x % 3 == 0:
        array.append(x)
    else:
        while x != 0:
            if x % 10 == 3:
                array.append(x)
                break
            x /= 10
    x += 1
print str(array).replace('[', ' ').replace(']', '').replace(',', '')

Submission status: Time Limit Exceeded

Solution code:
n = input()
x = 1
print ''
while 1:
  if x > n:
     break
  if ( x % 3 == 0 ) or ( '3' in str(x) ):
     print x
     x += 1

Submission status: Time Limit Exceeded

Solution code:
n = input()
for i in range(n):
  x = i
  if x%3==0:
    print ' %d' % x
  while x<=n:
    if x%10==3:
      print ' %d' % x
    else:
      x /= 10

Submission status: Time Limit Exceeded

Solution code:
n = input()
 
print '',
for i in xrange(1, n+1):
    x = i
    if x % 3 == 0:
        print i,
    else:
        while x:
            if x % 10 == 3:
                print i,
                break

Submission status: Time Limit Exceeded

Solution code:
n = int(raw_input())
cout = ""

for i in range(1,n+1):
	x = i

	if (x%3) == 0:
		cout = cout + " " + str(i)
		continue

	while x > 0:
		if (x%10) == 3:
			cout = cout + " " + str(i)
			continue
		x /= 10

print cout

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
for i in range(1,x+1):
    if i%3 ==0 or i%10 ==3:
        print(' ',i,end='',sep='')
    else:
        while True:
            if x <= i:
                print()
                break

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
for i in range(1,x+1):
    if i%3 ==0 or i%10 ==3:
        print(' ',i,end='',sep='')
    else:
        while True:
            if x <= i:
                print()
                break
            else:
                pass

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1
while i <= n:
 if i % 3 == 0:
  print(' {}'.format(i))
  continue
 elif i % 10 == 3:
  print(' {}'.format(i))
  continue

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1
while i <= n:
 if i % 3 == 0:
  print(' {0}'.format(i))
  continue
 elif i % 10 == 3:
  print(' {0}'.format(i))
  continue

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
i = 1
while i <= n:
 if i % 3 == 0:
  print(' {0}'.format(i))
  continue
 elif i % 10 == 3:
  print(' {0}'.format(i))
  continue
 i += 1

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
result =0
i=3
while i <=n:
    result/=i
    i/=i
    print(result)

Submission status: Accepted

Solution code:
import sys


def main():
    n = int(sys.stdin.readline())
    i = 1
    while i <= n:
        x = i
        if x % 3 == 0:
            print(' {}'.format(i), end='')
        else:
            while x > 1:
                if int(x) % 10 == 3:
                    print(' {}'.format(i), end='')
                    break
                x /= 10
        i += 1
    print()
    return


if __name__ == '__main__':
    main()