From 71a6e456b59171a681bccff7eeba9db7367bca37 Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Mon, 31 Oct 2016 22:21:50 +0700 Subject: Thêm đề Tin học trẻ Quốc gia 2016 Bảng B MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- THT/B/QG-2016/trigrid.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 THT/B/QG-2016/trigrid.py (limited to 'THT/B/QG-2016/trigrid.py') diff --git a/THT/B/QG-2016/trigrid.py b/THT/B/QG-2016/trigrid.py new file mode 100755 index 0000000..ea33d07 --- /dev/null +++ b/THT/B/QG-2016/trigrid.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + +a = (4, 3, 5, 6, 111, 222, 3333, 4444, 55555, 666666, 7777777, 88888888, + 999999999, 123456789123456789, 1000000000000000000) + +t = lambda n: n * (n + 2) * (n * 2 + 1) // 8 % 2016 + +with open('TRIGRID.TXT', 'w') as f: + for i in a: + f.write("{}\n".format(t(i))) -- cgit 1.4.1