又见GCD Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 18480 Accepted Submission(s): 7708 Problem Description 有三个正整数a,b,c(0<a,b,c<10^6),其中c不等于b.若a和c的最大公约数为b,现已知a和b,求满足条件的最小的c. Input 第一行输入一…
又见GCD Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10031 Accepted Submission(s): 4185 Problem Description 有三个正整数a,b,c(0<a,b,c<10^6),当中c不等于b.若a和c的最大公约数为b,现已知a和b,求满足条件的最小的c. Input 第一行输入一…
Problem Description 有三个正整数a,b,c(0 import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc= new Scanner(System.in); int t =sc.nextInt(); while(t-->0){ int a =sc.nextInt(); int b =sc.nextInt(); int c=0; for(int…
又见GCD Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 9207 Accepted Submission(s): 3782 Problem Description 有三个正整数a,b,c(0<a,b,c<10^6),其中c不等于b.若a和c的最大公约数为b,现已知a和b,求满足条件的最小的c. Input 第一行输入一个…
又见GCD Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 9984 Accepted Submission(s): 4157 Problem Description 有三个正整数a,b,c(0<a,b,c<10^6),当中c不等于b.若a和c的最大公约数为b,现已知a和b,求满足条件的最小的c. Input 第一行输入一个…
Different GCD Subarray Query Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 221 Accepted Submission(s): 58 Problem Description This is a simple problem. The teacher gives Bob a list of probl…