📄 toj_2916.cpp
字号:
/*2916. Help Me Time Limit: 1.0 Seconds Memory Limit: 65536KTotal Runs: 10 Accepted Runs: 3We all interested in mathematics and world are divided in to two parts. One who are interested in mathematics and other who are afraid of mathematics.Here is a equation: ( X * N ) % Y = 0Given two number X & Y you have to find minimum N that satisfies the equation.Input:Input consists of two positive integer X & Y . (1≤X,Y≤2000000000)Output:You have to output minimum N.Sample Input:1 56 7Sample Output:57Problem Idea: M.H. Rasel.Problem Setter: Md. Shakil Ahmed.Source: CUET individual contest*/#include<cstdio>int gcd( int a , int b ){ int static temp; while ( b != 0 ) { temp = a; a = b; b = temp % b; } return a;} int main(){ int x , y , n; while ( scanf( "%d%d" , &x , &y ) != EOF ) { n = y / gcd( x , y ); printf( "%d\n" , n); } return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -