JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
* Author : Gaurav Agrawal
* Created on 23rd january 2018
* Challenge ::: Circle Dot
Description :-
Assume there is a circle with n(even number) of points with
marking from 0 to n-1 with equal distance.
You have to find the point which is opposite to pointr.
Example:-
Input :- 10, 7
Output :- 7 is opposite to 2;
*/
import java.util.Scanner;
public class GauravProgram{
public static void main(String ... Gaurav){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt(),r=sc.nextInt();
System.out.print(n%2==0&&n>1?(r<n/2?r+n/2:r-n/2):"see instructions carefully");
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run