Given a circle of radius R, divide it into N pieces such that every piece is 1/Mth of the original circle, where N and M are positive non-zero integers and M>=N. Find the arc length of the piece of the circle that is left over after the distribution.
Example 1:
Input:
R=7.50
N=4
M=7
Output:
20.19
Explanation:
3/7th of the circle is left which equals 
20.19 arc length.
Example 2:
Input:
R=6.66
N=3
M=4
Output:
10.46
Explanation:
1/4th of the circle is left which equals 
10.46 of arc length.
Your Task:
You don't need to read input or print anything. Your task is to complete the function remainingCircle() which takes R, N, M as input parameters and returns the arc length of the portion of the circle left after removing N portions of size 1/Mth each.
Expected Time Complexity:O(1)
Expected Auxillary Space:O(1)
Constraints:
1<=R<=1000.0
1<=N<=M<=1000
Pi=3.14

Source: geeksforgeeks | Difficulty: EASY
Tags: Data structures

Mathematics

Starter code: #User function Template for python3

class Solution:
    def remainingCircle(self,R,N,M):
        #code here

Solutions:
class Solution:

	def remainingCircle(self, R, N, M):
		return 2 * 3.14 * R * ((M - N) / M)


class Solution:

	def remainingCircle(self, R, N, M):
		c = M % N
		return 6.28 * R * (M - N) / M


import math

class Solution:

	def remainingCircle(self, R, N, M):
		k = 2 * 3.14 * R * ((M - N) / M)
		return k


class Solution:

	def remainingCircle(self, r, n, m):
		a = 2 * 3.14 * r * (m - n) / m
		return a


class Solution:

	def remainingCircle(self, R, N, M):
		R *= 2 * 3.14 * (M - N)
		R /= M
		R *= 1000
		if R % 10 == 5:
			R //= 10
			R += 1
			R /= 100
		else:
			R /= 1000
		return R


class Solution:

	def remainingCircle(self, R, N, M):
		part = (M - N) / M
		return 6.28 * R * (M - N) / M


class Solution:

	def remainingCircle(self, r, n, m):
		ans = 2 * 3.14 * r * (m - n) / m
		return round(ans, 2)
import math
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		(R, N, M) = map(float, input().strip().split(' '))
		ob = Solution()
		ans = ob.remainingCircle(R, N, M)
		print('%.2f' % ans)


class Solution:

	def remainingCircle(self, R, N, M):
		return 6.28 * R * (M - N) / M
import math
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		(R, N, M) = map(float, input().strip().split(' '))
		ob = Solution()
		ans = ob.remainingCircle(R, N, M)
		print('%.2f' % ans)