Codeforces Round #834 (Div. 3) D. Make It Round
IT Codeforces div round Make
2023-09-11 14:14:52 时间
Code:
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int mxn=1e3+10,mod=998244353;
int n,m,cnt1=0,cnt2=0;
void solve(){
cnt1=0,cnt2=0;
cin>>n>>m;
int t=n;
while(n%2==0){
cnt1++;
n/=2;
}
while(n%5==0){
cnt2++;
n/=5;
}
int k=1;
while(cnt1<cnt2&&k*2<=m) k*=2,cnt1++;
while(cnt2<cnt1&&k*5<=m) k*=5,cnt2++;
while(k*10<=m) k*=10;
int h=m/k;
k*=h;
cout<<t*k<<'\n';
}
signed main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int T=1;
cin>>T;
while(T--)solve();
return 0;
}
相关文章
- Windows Services Recovery option doesn't work ... or I don't understand it RRS feed
- Is it a good approach to call return inside using {} statement?
- It’s Not Enough to Be Right—You Also Have to Be Kind
- IT公司面试经验汇总,都给我学
- 我,35岁的IT从业者,无路可走了?
- 【大厂】进不了测试IT工程师们,我们的出路到底在何方?
- Codeforces Round #783 (Div. 2) C. Make it Increasing
- 企业IT架构转型之道:阿里巴巴中台战略思想与架构实战. 1.1 阿里巴巴共享业务事业部的发展史
- UVa 658 It's not a Bug, it's a Feature! (状态压缩+Dijstra)
- 逢年过节,这才是IT男向亲人朋友解释自己工作的正确姿势
- 为什么要选择CS专业,助力未来IT人的报考指南
- IT行业常用的软件汇总及使用说明
- IDC:2016年云IT基础设施开支可达370亿美元
- Gartner预期2017年全球IT支出放缓 “数字业务”转型效果凸显
- 国产IT彪起来了,后浪要将前浪拍死在沙滩上
- [开心IT面试题] realloc用法
- 【codeforces】Codeforces Round #277 (Div. 2) 解读
- 陷入苦战 台湾地区IT企业连续8个月减收
- Use Spring Insight Developer to Analyze Code, Install it with Tomcat, and Extend it with Plugins--转载
- 2017年云IT基础设施支出达442亿美元
- 只有IT人才有机会得满分的高考试卷,但99%的程序员都败在第四道文综题上