Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Numerics;
- using System.Linq;
- namespace CatchTheTheif
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Console.WriteLine(long.MinValue);
- string idThief = Console.ReadLine();
- var num = int.Parse(Console.ReadLine());
- BigInteger max = 0;
- if (idThief == "sbyte")
- {
- max = sbyte.MaxValue;
- }
- if (idThief == "int")
- {
- max = int.MaxValue;
- }
- if (idThief == "long")
- {
- max = long.MaxValue;
- }
- BigInteger t = 0;
- List<BigInteger> getMax = new List<BigInteger>();
- for (int i = 0; i < num; i++)
- {
- BigInteger countIds = BigInteger.Parse(Console.ReadLine());
- if (countIds <= max)
- {
- getMax.Add(countIds);
- }
- }
- t = getMax.Max();
- Console.WriteLine(t);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement