using System; using System.Collections.Generic; //YukiCoder300 平方数 //http://yukicoder.me/problems/no/300 class Program { static string InputPattern = "InputX"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("4"); //1 } else if (InputPattern == "Input2") { WillReturn.Add("8"); //2 } else if (InputPattern == "Input3") { WillReturn.Add("459431198626"); //114514 } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); long X = long.Parse(InputList[0]); //平方数の倍数なら、その平方数で割る for (long I = 2; I * I <= X; I++) { long wkHeihouSuu = I * I; while (X % wkHeihouSuu == 0) X /= wkHeihouSuu; } Console.WriteLine(X); } }