From 06a239d47c3c54bf32d78f113acd72f03feca7ca Mon Sep 17 00:00:00 2001 From: Kotni Krishna Date: Sat, 9 Oct 2021 05:17:36 +0530 Subject: [PATCH] Problem Solving --- 1560A.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 1560A.py diff --git a/1560A.py b/1560A.py new file mode 100644 index 0000000..afe9b0a --- /dev/null +++ b/1560A.py @@ -0,0 +1,23 @@ +class Solution: + def __init__(self): + self.ans = [] + + i = 0 + count = 1 + while i!= 1003: + if count%3 !=0: + + if str(count)[-1] != "3": + i+=1 + self.ans.append(count) + count+=1 + + def find(self): + t = int(input()) + + for i in range(t): + x = int(input()) + print(self.ans[x-1]) + +obj = Solution() +obj.find()