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

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>
            亚洲高清不卡在线| 欧美国产日本在线| 欧美国产日产韩国视频| 久久中文精品| 在线电影一区| 国产精品乱子久久久久| 一级日韩一区在线观看| 亚洲在线一区二区三区| 韩国欧美一区| 国产日韩精品电影| 亚洲综合电影一区二区三区| 亚洲人成亚洲人成在线观看| 亚洲综合色在线| 欧美日韩情趣电影| 91久久精品国产91久久性色tv| 久久久久九九视频| 久久精品视频在线免费观看| 欧美图区在线视频| 国产精品白丝jk黑袜喷水| 国产精品亚洲网站| 亚洲黄一区二区三区| 欧美日本二区| 欧美成人激情视频免费观看| 欧美岛国激情| 欧美另类videos死尸| 久久久久久9999| 国产精品夜夜夜| 亚洲免费视频一区二区| 久久精品国产亚洲高清剧情介绍 | 国产日韩视频一区二区三区| 欧美午夜寂寞影院| 欧美不卡福利| 91久久午夜| 欧美凹凸一区二区三区视频| 欧美主播一区二区三区| 在线亚洲激情| 裸体一区二区| 巨乳诱惑日韩免费av| 欧美亚洲不卡| 一区二区在线免费观看| 久久成人精品无人区| 亚洲一区二三| 亚洲成人在线| 一区二区三区四区国产| 在线观看日韩精品| 免费久久99精品国产自在现线| 麻豆精品视频在线| 亚洲欧美日韩精品久久久久| 国产精品一级| 日韩午夜剧场| 欧美成人免费va影院高清| 亚洲激情欧美激情| 欧美日韩精品一区视频| 亚洲人成毛片在线播放| 久久先锋影音av| 99riav1国产精品视频| 欧美精品不卡| 欧美在线亚洲| 一区二区三区四区五区视频| 欧美日韩精品一区二区在线播放 | 欧美日韩亚洲一区二区三区在线| 欧美日韩国产综合在线| 亚洲欧洲精品一区二区精品久久久| 一区二区三区www| 亚洲影视在线| 国产精品视频你懂的| 欧美一区激情视频在线观看| 在线视频精品一区| 久久综合电影| 亚洲一区二区三区乱码aⅴ| 亚洲成在线观看| 老司机免费视频久久| 午夜天堂精品久久久久| 久久av老司机精品网站导航| 亚洲精品你懂的| 欧美h视频在线| 欧美国产乱视频| 尤物在线观看一区| 国产精品卡一卡二| 久久久精品网| 亚洲无人区一区| 在线成人激情| 亚洲综合色婷婷| 亚洲美女在线一区| 欧美国产日本在线| 欧美主播一区二区三区| 久久久久久黄| 伊人春色精品| 亚洲午夜在线观看视频在线| 99在线精品观看| 久久免费国产精品1| 欧美一区影院| 欧美日韩一二三四五区| 亚洲综合色丁香婷婷六月图片| 亚洲精品在线视频观看| 亚洲第一狼人社区| 久久久久久久网站| 老鸭窝91久久精品色噜噜导演| 亚洲毛片视频| 午夜亚洲视频| 亚洲国产高潮在线观看| 久久性天堂网| 欧美一级二区| 极品尤物av久久免费看| 欧美黑人在线播放| 国产精品视频第一区| 麻豆成人av| 久久精品av麻豆的观看方式| 国产亚洲欧美一区在线观看| 欧美一区二区日韩一区二区| 亚洲欧美在线看| 国产麻豆日韩欧美久久| 亚洲电影自拍| 久久中文字幕一区二区三区| 日韩天天综合| 鲁大师成人一区二区三区| 国产一区二区三区黄视频| 亚洲欧美日韩一区在线观看| 一区二区三区日韩欧美| 1000部精品久久久久久久久| 亚洲欧美日韩一区二区三区在线| 亚洲专区国产精品| 亚洲自拍都市欧美小说| 欧美日韩在线影院| 榴莲视频成人在线观看| 国产精品你懂的在线欣赏| 中文日韩在线| 国产精品久久久久7777婷婷| 午夜日韩视频| 久久综合给合久久狠狠狠97色69| 国产精品v片在线观看不卡| 一区二区三区不卡视频在线观看| 亚洲视频二区| 午夜欧美电影在线观看| 韩国视频理论视频久久| 亚洲乱码国产乱码精品精98午夜| 一区二区91| 亚洲欧洲一区二区三区| 欧美成人免费大片| 亚洲一区二区在线| 在线观看亚洲| 国产精品美女久久| 美女视频黄免费的久久| 国产精品爽黄69| 亚洲一区影院| 久久久久久亚洲精品中文字幕| 国产精品免费一区豆花| 日韩一级二级三级| 欧美一区二区黄| 国产精品日韩欧美一区二区| 亚洲一区二区三区色| 久久精选视频| 亚洲高清av| 国产精品福利久久久| 午夜免费久久久久| 亚洲视频一起| 亚洲区第一页| 欧美承认网站| 午夜精品成人在线| 在线视频亚洲| 国产色产综合产在线视频| 男人天堂欧美日韩| 欧美国产大片| 欧美经典一区二区三区| 欧美日韩国产另类不卡| 欧美特黄一级大片| 国产精品高清网站| 欧美午夜在线视频| 在线观看三级视频欧美| 亚洲永久网站| 亚洲激情在线观看| 亚洲综合另类| 99热这里只有精品8| 国产精品亚洲人在线观看| 国产精品欧美经典| 欧美精品久久99| 久久精品一区二区三区不卡牛牛| 欧美成人激情在线| 亚洲啪啪91| 亚洲日本一区二区三区| 99国产一区二区三精品乱码| 亚洲一区影音先锋| 香港久久久电影| 欧美另类一区| 国产一区二区三区日韩欧美| 可以免费看不卡的av网站| 午夜精品视频在线观看| 久久精品首页| 国产精品日韩一区| 亚洲免费观看| 一区二区三区在线不卡| 欧美一区二区在线| 久久一综合视频| 91久久国产综合久久蜜月精品 | 亚洲特级片在线| 久久久国产一区二区三区| 亚洲日本成人在线观看| 亚洲男人的天堂在线观看| 亚洲一区二区三区四区视频| 久久日韩粉嫩一区二区三区|