<>P1072 Hankson Interesting questions

Example of input and output input 2 41 1 96 288 95 1 37 1776 output 6 2
PS:
Derivation of phase division by rolling
import java.util.*; class Main{ public static void main(String args[]){
Scanner in= new Scanner(System.in); int n = in.nextInt(), a0, a1, b0, b1, count
= 0; while(n-- > 0){ a0 = in.nextInt(); a1 = in.nextInt(); b0 = in.nextInt(); b1
= in.nextInt(); count = 0; for(int i = 1; i * i <= b1; i++){ if(b1 % i == 0){ if
(cal(i, a0) == a1 && (i / cal(i, b0)) == b1 / b0) count++; if(b1 == i * i)
continue; if(cal(b1/i, a0) == a1 && (b0 / cal(b1/i, b0) == i)) count++; } }
System.out.println(count); } } static int cal(int a, int b){ if(b == 0) return a
; else return cal(b, a % b); } }

Technology
©2019-2020 Toolsou All rights reserved,
java Comparing attribute values between two objects utilize Python handle Excel data ——xlrd,xlwt library Bidirectional linked list Why? Python Not a future oriented programming language ?Python【 Assignment statement 】 Special lecture , You can't just a=b ah ! Suggest mastering ! utilize Python handle Excel data ——pandas library see SQL-SERVER Data volume and occupied space of database and each table PID The algorithm finally figured out the principle , It was so simple web Two front-end practical games ( Attached source code ) Beginners learn Python Be sure to know what his basic algorithms are ? What is the function ?