//

 
B. Duff in Love
time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

Duff is in love with lovely numbers! A positive integer x is called lovely if and only if there is no such positive integer a > 1 such that a2 is a divisor of x.

Malek has a number store! In his store, he has only divisors of positive integer n (and he has all of them). As a birthday present, Malek wants to give her a lovely number from his store. He wants this number to be as big as possible.

Malek always had issues in math, so he asked for your help. Please tell him what is the biggest lovely number in his store.

Input

The first and only line of input contains one integer, n (1 ≤ n ≤ 1012).

Output

Print the answer in one line.

Sample test(s)
input
10
output
10
input
12
output
6
Note

In first sample case, there are numbers 1, 2, 5 and 10 in the shop. 10 isn't divisible by any perfect square, so 10 is lovely.

In second sample case, there are numbers 1, 2, 3, 4, 6 and 12 in the shop. 12 is divisible by 4 = 22, so 12 is not lovely, while 6 is indeedlovely.

题目大意:
给你一个数 n,然后找它所有因子数中没有 平方数 的最大值
题解:每次寻找能被整除的平方数,再除去后递归
#include <stdio.h>
#define ll __int64
ll f(ll n)
{
    ll i, t;
   ;i*i<=n;i++)
        )
        {
        t = i;
        break;
        }
    if(i*i>n)
        return n;
    else
        return f(n/t);
}
int main()
{
    ll n;
    scanf("%I64d", &n);
    printf("%I64d\n", f(n));
    ;
}

Codeoforces 558 B. Duff in Love的更多相关文章

  1. Codeforces Round #326 (Div. 2) B. Pasha and Phone C. Duff and Weight Lifting

    B. Pasha and PhonePasha has recently bought a new phone jPager and started adding his friends' phone ...

  2. 【转】Duff's Device

    在看strcpy.memcpy等的实现发现用了内存对齐,每一个word拷贝一次的办法大大提高了实现效率,参加该blog(http://totoxian.iteye.com/blog/1220273). ...

  3. UVA 558 判定负环,spfa模板题

    1.UVA 558 Wormholes 2.总结:第一个spfa,好气的是用next[]数组判定Compilation error,改成nexte[]就过了..难道next还是特殊词吗 题意:科学家, ...

  4. Codeforces Round #326 (Div. 2)-Duff and Meat

    题意: Duff每天要吃ai千克肉,这天肉的价格为pi(这天可以买好多好多肉),现在给你一个数值n为Duff吃肉的天数,求出用最少的钱满足Duff的条件. 思路: 只要判断相邻两天中,今天的总花费 = ...

  5. 【LCA】CodeForce #326 Div.2 E:Duff in the Army

    C. Duff in the Army Recently Duff has been a soldier in the army. Malek is her commander. Their coun ...

  6. uva 558 - Wormholes(Bellman Ford判断负环)

    题目链接:558 - Wormholes 题目大意:给出n和m,表示有n个点,然后给出m条边,然后判断给出的有向图中是否存在负环. 解题思路:利用Bellman Ford算法,若进行第n次松弛时,还能 ...

  7. Codeforces Round #326 (Div. 2) D. Duff in Beach dp

    D. Duff in Beach Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/588/probl ...

  8. Codeforces Round #326 (Div. 2) C. Duff and Weight Lifting 水题

    C. Duff and Weight Lifting Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest ...

  9. Codeforces Round #326 (Div. 2) B. Duff in Love 分解质因数

    B. Duff in Love Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/588/proble ...

随机推荐

  1. demo14

    /Users/alamps/AndroidStudioProjects/Demo12SimpleAdapter/Demo12SimpleAdapter/src/main/res/layout/tabl ...

  2. [Ubuntu] Install teamviewer9 on Ubuntu14.04_x64

    The article copied from http://ubuntuhandbook.org/index.php/2013/12/install-teamviewer-ubuntu-1404/ ...

  3. [OrangePi] Backup internal EMMC to SD Card

    Boot your Orange PI board from EMMC without SD Card inserted login insert your SD Card Run: sudo ins ...

  4. linux系统中grub配置文件

    安装了Windows和Linux时肯定要通过GRUB进行引导,GRUB引导器的主配置文件路径/boot/grub/grub.conf(也可能是/boot/grub2/grub.conf),以#号开头的 ...

  5. 【NOIP模拟赛】工资

    工资 [试题描述] 聪哥在暑假参加了打零工的活动,这个活动分为n个工作日,每个工作日的工资为Vi.有m个结算工钱的时间,聪哥可以自由安排这些时间,也就是说什么时候拿钱,老板说的不算,聪哥才有发言权!( ...

  6. android提示框

    // 对话框 AlertDialog.Builder builder = new Builder(MainActivity.this); builder.setMessage("是否确认删除 ...

  7. 鸟哥的linux私房菜学习记录之档案与目录管理

    绝对路径和相对路径 绝对路径就是从根目录到某个目录下的路径,从根目录写起,也就是/ 相对路径就是从用户当前目录的路径写起 目录相关操作 cd 切换路径 例如:cd /var/www 切换到/var/w ...

  8. 【jQuery UI 1.8 The User Interface Library for jQuery】.学习笔记.2.更换主题

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

  9. sql中的小细节

    1.SUM与COUNT的区别 SUM是对符合条件的记录的数值列求和 COUNT 是对查询中符合条件的结果(或记录)的个数 2 select name as 姓名,tel  from...where.. ...

  10. OS开发拓展篇—应用之间的跳转和数据传

    iOS开发拓展篇-应用之间的跳转和数据传 说明:本文介绍app如何打开另一个app,并且传递数据. 一.简单说明 新建两个应用,分别为应用A和应用B. 实现要求:在appA的页面中点击对应的按钮,能够 ...