"Miscellaneous" poj2482 Stars in Your the translation of Windows facets

Source: Internet
Author: User

Original address: http://poj.org/problem?id=2482

God's title, known as the most romantic topic, a acmer in his own unique way to write a warm-hearted love language

The stars in front of your window

The longitudinal time flies, also I to your recollection also never sadly. It may have been four years since the first meeting. But, I remember, I remember clearly, four years ago that day, that scene, that a touch of sunshine, that curved smile, they like a knife, in my heart left so clear mark.

Four years ago, in the beautiful Zhuhai campus, inadvertently, I glimpsed your smiling figure. Fate is pulling my gaze to you. You gently cross the door of the class, and when your slender hand touches the door, you go back over your head. A soft glow of sunlight flows freely on your rosy cheeks. I am shocked to live, I know, I know clearly, I have been for the beautiful you and intoxicated. For a few months, I kept observing, inquiring, spying, and I found more of you. You who are gracious and compassionate, smart and intelligent, positive and optimistic, you with dreams, have a home inside of me. You want to be able to spend a lifetime with a glamour girl like you. Alas, in fact, you are far from my wildest dreams, and I don't know how to bridge the bay that separates you from mine. I have nothing to do but wait and wait for the blessing of the god of opportunity until now. The footsteps of graduation looming, I repentant, I incredibly is such a fool! Obviously can create opportunities and seize it, but I chose to wait in vain!

These days, old friends, roommates, classmates, one after the other farewell with me. I put down the waving hand, but can not accept the cruel truth. These familiar faces vanished from my life, and there was nothing left but memories. Tomorrow, I have to leave the familiar campus, and you, too, are planning to fly away, to capture your future and fulfill your dreams. I thought I would never see your face again if I had no luck or chance. So tonight, I am wandering in your dorm, I want to see you on the side. But I am very contradictory, if you appear, my heart will become very fast, and then my clumsy tongue will certainly not spit out a word. I don't remember how many times I passed in front of your dorm. Every time I have a strong desire to see you appear on the balcony, or see you reflected in the outline of the window. I do not remember how many times the idea was made: Call her name, ask her to come for dinner or at least say a word. But every thought of your excellence and my mediocrity, the timidity of courage forced me to leave the place quietly.

The graduation ceremony means the end of the university time, which is filled with the end of the age of honor and romance. Your lovely smile is the original power of my hard work, and this kind of love that can not be thanked, will also be sealed in my memory of the box.

Graduation ceremony, also means a new beginning, the path of life clear footprints pointing to the bright future. I sincerely hope that your time abroad can be full of happiness and victory! Of course, I will try to get rid of those childish ideas and become more mature. However, the pursuit of true love, the pursuit of real happiness, I will never let it dry.

Bye! My princess!

If one day, in a place, we are destined to meet again, even if it has become old woman and elderly. I hope that at that time, we can be good friends, happily share this glorious memory, the flame of youth is again ignited, again immersed in the pleasant atmosphere. If I do not get this opportunity, I would like to be a star, flashing in front of your window, in a faraway place bless you, as a friend, and you spend every night, sharing sweet dreams, through the endless evil dire.

So the question is, suppose the sky is a plane, each star has a coordinate (x, y), each star has a level ranging from 1 to 100, representing its brightness, where 100 is the brightest, and 1 is the weakest. The windows are rectangular, have a fixed length and width, and the sides are parallel to the X and Y axes. Your task is to show me how to put the windows in order to get the maximum total brightness of all the stars in the window. Note that the star of the border does not count. The window can be panned, but rotation is not allowed.

Input
There are several test cases in the input. The first line of each row contains 3 integers: N,w,h, which represents the number of stars, the horizontal length of the rectangular window, and the vertical height. Then the n rows are as follows, with 3 integers: X,y,c, which represents the star position (x, y) and the brightness of each star. There are no two stars at the same point.
There are at least 1 in the sky, with up to 10000 stars. 1 = W,h = 1000000,0 × x, y < 2^31.


Output
For each test case, output the maximum brightness in one row.
Sample input
3 5 4
1 2 3
2 3 2
6 3 1
3 5 4
1 2 3
2 3 2
5 3 1


Sample output
5

6

Source
POJ Contest, Kinfkong @ZSU, translator: nitrate

Not reproduced without permission

"Miscellaneous" poj2482 Stars in Your the translation of Windows facets

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.