This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class main{ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
while(input.hasNext()) { | |
long g = input.nextLong(); | |
long s = input.nextLong(); | |
long sum = 0; | |
long result = 0; | |
if(g > s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class main{ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
while(input.hasNext()) { | |
int x = input.nextInt(); | |
input.nextLine(); | |
String str = input.nextLine(); | |
String []str_arr = str.split(" "); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class main{ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
int numbers = input.nextInt(); | |
for(int i=1;i<=numbers;i++) { | |
int x = input.nextInt(); | |
int y = input.nextInt(); | |
int x_add_y = x + y; | |
if(x_add_y % 2 != 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class main{ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
int number = input.nextInt(); | |
int count = 1; | |
for(int i=1;i<=number;i++) { | |
input.next(); | |
input.next(); | |
int num = input.nextInt(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class main{ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
int count = 0; | |
String result = ""; | |
while(true) { | |
int a = input.nextInt(); | |
int b = input.nextInt(); | |
if(a == 0 && b == 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class main{ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
long result = 0; | |
while(input.hasNext()) { | |
long v = input.nextLong(); | |
long s = input.nextLong(); | |
result = v * s * 2; | |
System.out.print(result + "\r\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class main{ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
int []fib_arr = new int[39]; | |
fib_arr[0] = 1; | |
fib_arr[1] = 2; | |
for(int i=2;i<39;i++) { | |
fib_arr[i] = fib_arr[i-1] + fib_arr[i-2]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class main{ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
while(input.hasNext()) { | |
int result = 0; | |
int N = input.nextInt(); | |
if(N == 0) | |
break; | |
for(int i=1;i<N;i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class main{ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
while(input.hasNext()) { | |
double s = input.nextDouble(); | |
double a = input.nextDouble(); | |
String deg_min = input.next(); | |
if(deg_min.equals("min")) { | |
a /= 60; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class main{ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
while(input.hasNext()) { | |
String str = ""; | |
int number = input.nextInt(); | |
int []nums = new int[number]; | |
for(int i=0;i<number;i++) { | |
nums[i] = input.nextInt(); |