Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Diagnostics;
- using System.Threading;
- using static System.Math;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Stopwatch stopWatch = new Stopwatch();
- UInt64 math(UInt64 cabbage)
- {
- if (cabbage <= 2)
- {
- Console.WriteLine("Кочанов не может быть меньше, чем 3");
- return 0;
- }
- UInt64 hares = Convert.ToUInt64(Sqrt(cabbage));
- while (cabbage/hares != cabbage / (hares + 1))
- {
- hares = hares + 1;
- }
- return hares;
- }
- UInt64 count = Convert.ToUInt64(Console.ReadLine());
- UInt64[] print = new UInt64[count];
- for (UInt64 i = 0; i < count; i++)
- {
- UInt64 n = Convert.ToUInt64(Console.ReadLine());
- print[i] = math(n);
- }
- for (UInt64 i = 0; i < count;i++)
- {
- Console.WriteLine(print[i]);
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment