Codeforces: C. Beautiful Sets of Points


The problem is from codeforces: http://www.codeforces.com/problemset/problem/268/C

268C Codeforces: C. Beautiful Sets of Points codeforces geometry implementation math programming languages python

This problem is put at the third problem in the online contests. But it seems too easy for being in that place. The sample inputs are there to complicate the problem but if you pay attention to the problem description, you will simplify the problem as putting the maximum number of points in the rectangle area, where tex_7fbbd682dacaaefdbaf24ac6147dd27d Codeforces: C. Beautiful Sets of Points codeforces geometry implementation math programming languages python and tex_5bf804fb9b109335670a2ab5e5a2948b Codeforces: C. Beautiful Sets of Points codeforces geometry implementation math programming languages python such that tex_9b372777ee653d93261dd583df1734ff Codeforces: C. Beautiful Sets of Points codeforces geometry implementation math programming languages python and tex_bfa38bc50969763f8437cffee2223e38 Codeforces: C. Beautiful Sets of Points codeforces geometry implementation math programming languages python and tex_b773dfffe8d228b122f098da902fe696 Codeforces: C. Beautiful Sets of Points codeforces geometry implementation math programming languages python , if you multiply the tex_d88df3f5d32607ef51e2cc33c99af4b1 Codeforces: C. Beautiful Sets of Points codeforces geometry implementation math programming languages python with a integer, it still is not an integer.

The solution is thus simple, place, start from (0, n) and each time, increase and decrease y, until the point reaches the x axis. The count of the numbers is tex_7a55fd0c2a34e8269500549d8bd9521c Codeforces: C. Beautiful Sets of Points codeforces geometry implementation math programming languages python .

#!/usr/bin/env python
n, m = map(int, raw_input().split())
k = min(n, m)
print k + 1
for x in xrange(k + 1):
    print x, k - x

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
532 words
Last Post: Codeforces: 268B. Buttons
Next Post: Heron's Formula for the area of a triangle

The Permanent URL is: Codeforces: C. Beautiful Sets of Points

2 Comments

  1. fool_01
  2. K

Leave a Reply