A. k-rounding

time limit per test:1 second
memory limit per test:256 megabytes
input:standard input
output:standard output

For a given positive integer n denote its k-rounding as the minimum positive integer x, such that x ends with k or more zeros in base 10 and is divisible by n.

For example, 4-rounding of 375 is 375·80 = 30000. 30000 is the minimum integer such that it ends with 4 or more zeros and is divisible by 375.

Write a program that will perform the k-rounding of n.

Input

The only line contains two integers n and k (1 ≤ n ≤ 109, 0 ≤ k ≤ 8).

Output

Print the k-rounding of n.

Examples
Input
375 4
Output
30000
Input
10000 1
Output
10000
Input
38101 0
Output
38101
Input
123456789 8
Output
12345678900000000

题目链接:http://codeforces.com/contest/861/problem/A

题意: x的末尾有k个以上的0; 且x是n的倍数,x/(10^k) 是 n的倍数,x是10^k的倍数

下面给出AC代码:

 #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b)
{
return b==?a:gcd(b,a%b);
}
int main(void)
{
ll n,k;
cin>>n>>k;
ll temp=;
for(ll i=;i<=k;i++)
temp*=;
cout<<n*temp/gcd(temp,n);
}

Codeforces Round #434 (Div. 2, based on Technocup 2018 Elimination Round 1)&&Codeforces 861A k-rounding【暴力】的更多相关文章

  1. Codeforces Round #434 (Div. 2, based on Technocup 2018 Elimination Round 1)&&Codeforces 861C Did you mean...【字符串枚举,暴力】

    C. Did you mean... time limit per test:1 second memory limit per test:256 megabytes input:standard i ...

  2. Codeforces Round #434 (Div. 2, based on Technocup 2018 Elimination Round 1)&&Codeforces 861B Which floor?【枚举,暴力】

    B. Which floor? time limit per test:1 second memory limit per test:256 megabytes input:standard inpu ...

  3. Codeforces Round #434 (Div. 2, based on Technocup 2018 Elimination Round 1)

    A. k-rounding 题目意思:给两个数n和m,现在让你输出一个数ans,ans是n倍数且末尾要有m个0; 题目思路:我们知道一个数末尾0的个数和其质因数中2的数量和5的数量的最小值有关系,所以 ...

  4. 【模拟】 Codeforces Round #434 (Div. 1, based on Technocup 2018 Elimination Round 1) C. Tests Renumeration

    题意:有一堆数据,某些是样例数据(假设X个),某些是大数据(假设Y个),但这些数据文件的命名非常混乱.要你给它们一个一个地重命名,保证任意时刻没有重名文件的前提之下,使得样例数据命名为1~X,大数据命 ...

  5. Codeforces Round #440 (Div. 2, based on Technocup 2018 Elimination Round 2)

    A. Search for Pretty Integers 题目链接:http://codeforces.com/contest/872/problem/A 题目意思:题目很简单,找到一个数,组成这个 ...

  6. Codeforces Round #440 (Div. 2, based on Technocup 2018 Elimination Round 2) D. Something with XOR Queries

    地址:http://codeforces.com/contest/872/problem/D 题目: D. Something with XOR Queries time limit per test ...

  7. Codeforces Round #440 (Div. 1, based on Technocup 2018 Elimination Round 2) C - Points, Lines and Ready-made Titles

    C - Points, Lines and Ready-made Titles 把行列看成是图上的点, 一个点(x, y)就相当于x行 向 y列建立一条边, 我们能得出如果一个联通块是一棵树方案数是2 ...

  8. Codeforces Round #440 (Div. 2, based on Technocup 2018 Elimination Round 2) C. Maximum splitting

    地址: 题目: C. Maximum splitting time limit per test 2 seconds memory limit per test 256 megabytes input ...

  9. ACM-ICPC (10/15) Codeforces Round #440 (Div. 2, based on Technocup 2018 Elimination Round 2)

    A. Search for Pretty Integers You are given two lists of non-zero digits. Let's call an integer pret ...

随机推荐

  1. web项目错误页面友好处理404,500等

    写在前面: 在web项目中,可能会出现404.500等错误页面,给用户体验不怎么好,所以我们可以对这些错误页面进行友好的处理. 步骤: 1.配置web.xml: <!-- 错误页面友好显示 -- ...

  2. jsp程序设计:jstl之JSTL标签库

    转载自:http://www.blogjava.net/haizhige/archive/2008/10/26/236783.html,个人进行了一些修改. 前言:写一个taglib一般可以继承Sim ...

  3. Linux 学习记录 五(软件的安装升级).

    一.gcc gcc是Linux上面最标准的C语言的编译程序,用来源代码的编译链接. gcc -c hello.c 编译产生目标文件hello.o gcc -O hello.c 编译产生目标文件,并进行 ...

  4. NOIP2002 字符变换

    啊本来以为2002的题应该会比较友善于是很naive地像模拟一样用着stl乱玩结果死也过不了最后一个点qaq 心情很悲痛于是为了解放自我 #include<iostream> #inclu ...

  5. chmod 命令详解

    chmod 作用:修改目录或文件权限(= 赋值不管存在与否, + 增加权限)符号链接的权限无法变更, 如果用户对符号链接修改权限, 其改变会作用在被链接的原始文件. 参数: -R: 递归修改处理 -v ...

  6. ArcGIS API for Javascript 加载天地图(墨卡托投影)

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  7. 微信红包店小程序开发过程中遇到的问题 php获取附近周边商家 显示最近商家

    最近公司在做一个项目就是微信红包店.仿照的是微信官方在做的那个红包店的模式.客户抢红包,抢到以后到店消费,消费以后就可以拿到商家的红包了. 项目中的两个难点: 1通过小程序来发红包  这个之前在开发语 ...

  8. [Android游戏开发]八款开源 Android 游戏引擎 (巨好的资源)

    初学Android游戏开发的朋友,往往会显得有些无所适从,他们常常不知道该从何处入手,每当遇到自己无法解决的难题时,又往往会一边羡慕于 iPhone下有诸如Cocos2d-iphone之类的免费游戏引 ...

  9. 学习整理与细化(2)——HTML VS XHTML

    <html> <head>//文档头 <title>webpage title</title> </head> <body>// ...

  10. MySQL优化二 缓存参数优化

    数据库属于 IO密集型的应用程序,其主要职责就是数据的管理及存储工作.而我们知道,从内存中读取一个数据库的时间是微秒级别,而从一块普通硬盘上读取一个IO是在毫秒级别,二者相差3个数量级.所以,要优化数 ...