using System;
using System.Collections.Generic;
public class Test
{
public static void Main() {
var list = new List<Point>();
list.Add(new Point(10, 20));
list.Add(new Point(20, 40));
list.Add(new Point(40, 80));
list[1].X = 30;
foreach(var pt in list) {
Console.WriteLine(pt);
}
}
class Point {
public int X { get; set; }
public int Y { get; set; }
public Point(int x, int y) {
X = x;
Y = y;
}
public override String ToString() {
return String.Format("X = {0}, Y = {1}", X, Y);
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKCnB1YmxpYyBjbGFzcyBUZXN0CnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkgewoJCXZhciBsaXN0ID0gbmV3IExpc3Q8UG9pbnQ+KCk7CgkJbGlzdC5BZGQobmV3IFBvaW50KDEwLCAyMCkpOwoJCWxpc3QuQWRkKG5ldyBQb2ludCgyMCwgNDApKTsKCQlsaXN0LkFkZChuZXcgUG9pbnQoNDAsIDgwKSk7CgkJCgkJbGlzdFsxXS5YID0gMzA7CgkJCgkJZm9yZWFjaCh2YXIgcHQgaW4gbGlzdCkgewoJCQlDb25zb2xlLldyaXRlTGluZShwdCk7CgkJfQoJfQoJCgljbGFzcyBQb2ludCB7CgkJCgkJcHVibGljIGludCBYIHsgZ2V0OyBzZXQ7IH0KCQlwdWJsaWMgaW50IFkgeyBnZXQ7IHNldDsgfQoJCQoJCXB1YmxpYyBQb2ludChpbnQgeCwgaW50IHkpIHsKCQkJWCA9IHg7CgkJCVkgPSB5OwoJCX0KCQkKCQlwdWJsaWMgb3ZlcnJpZGUgU3RyaW5nIFRvU3RyaW5nKCkgewoJCQlyZXR1cm4gU3RyaW5nLkZvcm1hdCgiWCA9IHswfSwgWSA9IHsxfSIsIFgsIFkpOwoJCX0KCX0KfQ==