Given two integer H and R where H is the time in hours at a place X and R is the distance in degrees from place X to India, the task is to find the current time in IST.
UTC (Coordinated Universal Time) is a 24-hour time standard that is used to synchronize world clocks.
Input: H = 24, R = 82.50
Output: IST = 5:30
IST = (24/360)* 82.50
= 0.5*60 (i.e 60 minute = 360 degree rotation and 1 minute = 6 degree so, 0.5 hour * 60 = 30)
IST = 5:30
Input: H = 20, R = 150
Output: IST = 8:20
- It is known that 1 hour = 60 minute = 360 degree rotation.
- 1 degree rotation = (1 / 360) hour.
- 2 degree rotation = (1 / 360) * 2 hour.
- So, Generalised formula will be:
IST = UTC + (H / 360) * R (UTC = 0 for IST) IST = ( H / 360 ) * R
The answer will be converted in 0:00 form so int part (hour) and float part in IST are separated and the float part is multiplied by 60 to convert it into minutes.
Below is the implementation of the above approach:
- Calculate speed, distance and time
- Minimum time to reach a point with +t and -t moves at time t
- Set in C++ Standard Template Library (STL)
- Program to implement standard error of mean
- Mathematics | Mean, Variance and Standard Deviation
- Given N and Standard Deviation, find N elements
- Variance and standard-deviation of a matrix
- Standard Normal Distribution (SND) - Java Program
- Program to implement standard deviation of grouped data
- Calculate the Discriminant Value
- Program to calculate value of nCr
- C program to calculate the value of nPr
- Efficient program to calculate e^x
- Program to calculate the value of nCr Efficiently
- Program to calculate the value of sin(x) and cos(x) using Expansion
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.