From 1229758202e0061852d6b244f0556024d737fd44 Mon Sep 17 00:00:00 2001 From: vishakha2108 <50831546+vishakha2108@users.noreply.github.com> Date: Mon, 21 Oct 2019 10:21:25 +0530 Subject: [PATCH] Create Vishakha.java --- math&logic/ConfusedMonk/Vishakha.java | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 math&logic/ConfusedMonk/Vishakha.java diff --git a/math&logic/ConfusedMonk/Vishakha.java b/math&logic/ConfusedMonk/Vishakha.java new file mode 100644 index 0000000..b9cf609 --- /dev/null +++ b/math&logic/ConfusedMonk/Vishakha.java @@ -0,0 +1,47 @@ +import java.util.*; + class TestClass { + static int gcd(int x,int y) + { + if(x==0||y==0) + { + return 0; + } + else if(y == x) + { + return x; + } + else if(x>y) + return gcd(x-y,y); + else + return gcd(x,y-x); + + } + public static void main(String args[] ) throws Exception { + Scanner in = new Scanner(System.in); + int n = in.nextInt(); + int arr[] = new int[n]; + int m = 1000000007; + long f = 1; + for(int i = 0;im) + { + f = f%m; + } + + } + //System.out.println(f); + int g = arr[0]; + for(int i = 1;i