You are simply given two numbers 355 and 113. You just have to find the value of 355/113 upto the decimal  k places . 
 
Example 1:
Input: k = 0
Output: 3
Explanation: 355/113 upto 0 decimal place is 3
Example 2:
Input: k = 1
Outptut: 3.1
Explanation: 355/113 upto 1 decimal place is 3.1
 
Your Task:
You don't need to read or print anything. Your task is to complete the function upto_K_places() which takes k as input parameter and returns 355/113 upto k decimal places in string format.
Expected Time Complexity: O(k)
Expected Space Complexity: O(1)
 
Constraints: 
1 <= k <= 10000

Source: geeksforgeeks | Difficulty: EASY
Tags: Mathematics

Starter code: #User function Template for python3

class Solution:
	def upto_K_places(self, k):
		# Code here

Solutions:
class Solution:

	def upto_K_places(self, k):
		if k == 0:
			return 3
		p = 355 % 113
		t = '3.'
		p = p * 10
		c = 0
		while c != k:
			d = p // 113
			t += str(d)
			p = p % 113 * 10
			c += 1
		return t


class Solution:

	def upto_K_places(self, k):
		if k == 0:
			return 355 // 113
		x = 355
		y = 113
		d = x // y
		result = str(355 // 113) + '.'
		for i in range(k):
			x = x - y * d
			x = x * 10
			d = x // y
			result += str(d)
		return result
if __name__ == '__main__':
	T = int(input())
	for i in range(T):
		k = int(input())
		ob = Solution()
		ans = ob.upto_K_places(k)
		print(ans)


from decimal import *

class Solution:

	def upto_K_places(self, k):
		val = Context(prec=k + 1, rounding=ROUND_DOWN)
		setcontext(val)
		return Decimal(355) / Decimal(113)
if __name__ == '__main__':
	T = int(input())
	for i in range(T):
		k = int(input())
		ob = Solution()
		ans = ob.upto_K_places(k)
		print(ans)