青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Reactor Cooling

Time Limit: 5 Seconds      Memory Limit: 32768 KB      Special Judge

The terrorist group leaded by a well known international terrorist Ben Bladen is buliding a nuclear reactor to produce plutonium for the nuclear bomb they are planning to create. Being the wicked computer genius of this group, you are responsible for developing the cooling system for the reactor.

The cooling system of the reactor consists of the number of pipes that special cooling liquid flows by. Pipes are connected at special points, called nodes, each pipe has the starting node and the end point. The liquid must flow by the pipe from its start point to its end point and not in the opposite direction.

Let the nodes be numbered from 1 to N. The cooling system must be designed so that the liquid is circulating by the pipes and the amount of the liquid coming to each node (in the unit of time) is equal to the amount of liquid leaving the node. That is, if we designate the amount of liquid going by the pipe from i-th node to j-th as fij, (put fij = 0 if there is no pipe from node i to node j), for each i the following condition must hold:

fi,1+fi,2+...+fi,N = f1,i+f2,i+...+fN,i

Each pipe has some finite capacity, therefore for each i and j connected by the pipe must be fij <= cij where cij is the capacity of the pipe. To provide sufficient cooling, the amount of the liquid flowing by the pipe going from i-th to j-th nodes must be at least lij, thus it must be fij >= lij.

Given cij and lij for all pipes, find the amount fij, satisfying the conditions specified above.


This problem contains multiple test cases!

The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks.

The output format consists of N output blocks. There is a blank line between output blocks.


Input

The first line of the input file contains the number N (1 <= N <= 200) - the number of nodes and and M - the number of pipes. The following M lines contain four integer number each - i, j, lij and cij each. There is at most one pipe connecting any two nodes and 0 <= lij <= cij <= 10^5 for all pipes. No pipe connects a node to itself. If there is a pipe from i-th node to j-th, there is no pipe from j-th node to i-th.


Output

On the first line of the output file print YES if there is the way to carry out reactor cooling and NO if there is none. In the first case M integers must follow, k-th number being the amount of liquid flowing by the k-th pipe. Pipes are numbered as they are given in the input file.


Sample Input

2

4 6
1 2 1 2
2 3 1 2
3 4 1 2
4 1 1 2
1 3 1 2
4 2 1 2

4 6
1 2 1 3
2 3 1 3
3 4 1 3
4 1 1 3
1 3 1 3
4 2 1 3


Sample Input

NO

YES
1
2
3
2
1
1



Author: Andrew Stankevich
Source: Andrew Stankevich's Contest #1

relable_to_front

只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


posts - 3, comments - 1, trackbacks - 0, articles - 16

Copyright © lenohoo

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲大胆女人| 久久先锋影音av| 亚洲一区二区黄| 亚洲精品欧美极品| 91久久综合亚洲鲁鲁五月天| 在线观看亚洲a| 激情av一区| 亚洲高清久久| 久久av在线| 久久久国产午夜精品| 美女黄毛**国产精品啪啪| 久久婷婷蜜乳一本欲蜜臀| 久久久久久久久久久久久9999| 午夜精品网站| 久久综合婷婷| 亚洲激情第一区| 一区二区三区精品视频| 亚洲欧美日韩一区二区三区在线观看| 午夜欧美精品| 亚洲天堂激情| 欧美在线免费视屏| 欧美成人激情在线| 国产精品国产一区二区| 韩国三级电影久久久久久| 亚洲精品久久在线| 欧美一区激情| 欧美激情久久久久| 亚洲一区免费网站| 欧美成人乱码一区二区三区| 亚洲综合国产| 亚洲午夜国产一区99re久久 | 欧美14一18处毛片| 欧美性大战久久久久久久蜜臀| 国产欧美一区二区精品婷婷| 亚洲精品黄色| 亚洲福利视频二区| 亚洲一区二区三区涩| 麻豆精品在线观看| 亚洲精品小视频在线观看| 欧美亚洲免费电影| 欧美日韩视频一区二区| 亚洲国产高清一区| 欧美一区二区三区在线观看 | 欧美激情片在线观看| 亚洲一区二区综合| 欧美国产一区在线| 伊人久久大香线| 欧美一二三视频| 一区二区动漫| 欧美日韩免费区域视频在线观看| 国精品一区二区| 先锋影音久久久| 99热在这里有精品免费| 亚洲欧美日韩国产中文在线| 欧美激情精品| 亚洲精品国产精品国产自| 久久一区二区三区av| 亚洲免费一在线| 国产精品国产成人国产三级| 一区二区三区免费网站| 亚洲国产综合在线看不卡| 久久免费视频在线| 国产美女精品| 亚洲人成77777在线观看网| 久久不射中文字幕| 亚洲欧美日韩另类| 国产精品久久久久永久免费观看| 亚洲深夜福利视频| 亚洲精品一区久久久久久| 欧美看片网站| 亚洲天堂网站在线观看视频| 亚洲精品网站在线播放gif| 欧美日韩国产欧美日美国产精品| 99成人精品| 日韩写真在线| 国产精品国产三级欧美二区| 亚洲欧美日韩中文在线制服| 亚洲伊人观看| 韩国欧美一区| 亚洲成色999久久网站| 欧美不卡一卡二卡免费版| 亚洲狼人精品一区二区三区| 日韩视频在线观看| 国产精品久久久久婷婷| 欧美在线视频播放| 久久久久久久网| 亚洲国产婷婷香蕉久久久久久| 亚洲高清123| 国产精品多人| 久久综合九色综合欧美狠狠| 麻豆精品91| 一本高清dvd不卡在线观看| 亚洲天堂男人| 伊人久久久大香线蕉综合直播| 亚洲国产美女精品久久久久∴| 欧美久久精品午夜青青大伊人| 亚洲欧美春色| 老司机精品福利视频| 中文一区字幕| 欧美一区成人| 国产视频久久久久久久| 欧美国产日韩精品| 国产精品每日更新| 欧美电影打屁股sp| 国产精品久久久久一区| 欧美高清在线视频| 国产精品视频| 免费成人网www| 欧美日韩中文在线观看| 美女视频黄免费的久久| 国产精品看片资源| 亚洲国产aⅴ天堂久久| 国产情侣久久| 一本色道**综合亚洲精品蜜桃冫| 一区二区三区在线免费视频| 亚洲一区二区三区免费观看| 亚洲国产精品国自产拍av秋霞| 亚洲午夜电影网| 日韩一级在线| 狂野欧美一区| 久久―日本道色综合久久| 欧美视频在线视频| 亚洲国产精品va在线观看黑人| 国产午夜亚洲精品理论片色戒| 亚洲精品一区二区三区婷婷月| 在线不卡亚洲| 欧美福利视频| 韩国av一区二区三区| 亚洲视频在线观看视频| 最新国产成人在线观看| 久久精品国产一区二区电影| 午夜一级久久| 欧美性一二三区| 9久re热视频在线精品| 亚洲精品影院在线观看| 老鸭窝亚洲一区二区三区| 开心色5月久久精品| 激情五月综合色婷婷一区二区| 午夜视频在线观看一区二区三区| 欧美亚洲视频在线观看| 国产乱码精品一区二区三区av| 中文一区在线| 欧美在线日韩在线| 国产一区二区按摩在线观看| 性色一区二区三区| 久久久av网站| 狠狠色丁香久久婷婷综合丁香| 欧美在线观看视频一区二区| 久久综合激情| 亚洲精品日韩综合观看成人91| 欧美国产日韩一区二区| 亚洲精品护士| 香蕉久久夜色精品国产| 韩日欧美一区二区三区| 老**午夜毛片一区二区三区| 亚洲高清视频一区二区| 日韩一区二区高清| 国产精品va在线| 欧美一区二区在线免费观看| 噜噜噜久久亚洲精品国产品小说| 亚洲高清视频在线观看| 欧美女同在线视频| 亚洲午夜精品视频| 久久先锋资源| 9色porny自拍视频一区二区| 国产精品久久久久久模特| 午夜宅男久久久| 欧美成人午夜免费视在线看片| 亚洲国产日韩欧美综合久久| 欧美精品在线观看播放| 中文日韩在线视频| 午夜久久久久久久久久一区二区| 韩日视频一区| 免费一区二区三区| 亚洲制服丝袜在线| 久久精品国产久精国产爱| 国产三级欧美三级| 久久久久久久网| 亚洲深夜激情| 久久九九精品99国产精品| 一区一区视频| 亚洲欧美日韩国产中文| 久久久噜噜噜久久中文字幕色伊伊| 国内精品久久久久伊人av| 久久午夜精品| 亚洲免费视频成人| 麻豆精品91| 一二三区精品福利视频| 久久久午夜精品| 亚洲中无吗在线| 欧美国产日韩一区二区三区| 亚洲婷婷综合色高清在线 | 中文高清一区| 久久一二三国产| 久久成人免费网| 亚洲国产老妈| 亚洲欧美国产精品桃花| 91久久精品网| 一区二区激情小说| 亚洲激情午夜|