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

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| 夜夜嗨av色一区二区不卡| 亚洲国产91精品在线观看| 亚洲一区一卡| 午夜在线视频观看日韩17c| 国产精品久久久久久久午夜片| 久久久在线视频| 亚洲国产精品电影在线观看| 亚洲日本视频| 国产精品免费一区二区三区观看| 亚洲自拍偷拍麻豆| 午夜视频在线观看一区| 亚洲人成网站999久久久综合| 夜夜嗨av一区二区三区网页| 国产日韩欧美亚洲| 亚洲国产精品一区二区久 | 国产精品视频一二三| 久久国产精品一区二区三区| 久久久久久久久久久一区| 亚洲美洲欧洲综合国产一区| 亚洲伊人网站| 夜夜嗨av色一区二区不卡| 久久成人在线| 欧美在线免费观看视频| 欧美日韩在线视频首页| 亚洲黄色大片| 国产一区二区三区自拍| 亚洲视频在线观看| 在线一区二区日韩| 欧美激情国产日韩| 老司机精品视频一区二区三区| 国产精品久久久久久久电影| av成人动漫| 亚洲一区二区三区午夜| 欧美日韩在线观看视频| 亚洲视频免费| 久久全球大尺度高清视频| 国产综合色产在线精品| 久久精品国产第一区二区三区| 欧美中文在线视频| 激情视频一区二区| 亚洲成人在线网站| 老司机67194精品线观看| 欧美精品一区二区高清在线观看| 免费观看国产成人| 亚洲视频在线观看一区| 9色精品在线| 亚洲免费在线观看视频| 欧美一区二区私人影院日本| 久久久久国产一区二区三区四区| 亚洲精品永久免费| 尤物视频一区二区| 亚洲精品美女91| 亚洲自拍16p| 免费久久99精品国产自| 亚洲精品国产精品国自产观看| 日韩一区二区电影网| 亚洲嫩草精品久久| 久久综合中文字幕| 国产精品久久一级| 亚洲级视频在线观看免费1级| 中文一区二区| 麻豆精品一区二区av白丝在线| 亚洲日本中文| 久久久久91| 国产麻豆一精品一av一免费| 亚洲国产精品成人精品| 亚洲欧美在线网| 亚洲国产aⅴ天堂久久| 欧美一区二区黄色| 欧美三日本三级三级在线播放| 在线看不卡av| 久久久无码精品亚洲日韩按摩| 99pao成人国产永久免费视频| 久久久久久高潮国产精品视| 欧美性jizz18性欧美| 亚洲精品一二三| 蜜桃精品一区二区三区 | 久久综合狠狠| 久久国产一区| 性视频1819p久久| 欧美午夜精品伦理| 亚洲精品乱码久久久久久久久| 久久精品一区二区三区不卡牛牛| 中文在线不卡| 国产欧美另类| 老鸭窝毛片一区二区三区| 欧美在线精品免播放器视频| 国产一区二区在线免费观看| 香蕉久久夜色精品| 欧美一级片久久久久久久| 国产深夜精品福利| 久久综合色8888| 欧美高清视频| 午夜日韩福利| 久久综合网色—综合色88| 亚洲啪啪91| 亚洲网站在线观看| 亚洲国产91| 亚洲已满18点击进入久久| 国产综合久久久久久| 亚洲黄色大片| 国产一区二区黄色| 亚洲国产日韩美| 国产精品乱人伦中文| 欧美电影打屁股sp| 国产精品人成在线观看免费 | 这里是久久伊人| 激情成人av在线| 一卡二卡3卡四卡高清精品视频 | 欧美一区二区三区在线免费观看| 好吊色欧美一区二区三区视频| 最新国产乱人伦偷精品免费网站| 国产精自产拍久久久久久| 亚洲第一天堂av| 国产毛片一区| 一区二区三区不卡视频在线观看| 一区二区三区在线免费观看| 一区二区三区成人| 在线亚洲一区| 欧美人成免费网站| 亚洲日本成人| 日韩午夜三级在线| 欧美a级片网| 好看的亚洲午夜视频在线| 亚洲一区综合| 国产精品成av人在线视午夜片| 亚洲国产精品va| 国产农村妇女精品一区二区| 久久亚洲影院| 噜噜噜在线观看免费视频日韩| 亚洲欧美日韩区| 久久综合狠狠综合久久综合88| 亚洲无玛一区| 欧美日本中文字幕| 亚洲电影在线| 亚洲美女毛片| 欧美另类在线播放| 亚洲人午夜精品免费| 亚洲一区二区免费看| 国产精品网站在线| 香蕉久久一区二区不卡无毒影院| 国产精品白丝黑袜喷水久久久 | 欧美成人激情在线| 亚洲蜜桃精久久久久久久| 亚洲男人av电影| 在线播放日韩专区| 欧美午夜一区二区| 欧美一区二区三区四区夜夜大片 | 亚洲男人第一网站| 国产精品高潮呻吟久久| 一区二区国产日产| 久久精品中文字幕一区| 亚洲人成欧美中文字幕| 国产日本欧美在线观看 | 欧美一级免费视频| 亚洲精品综合精品自拍| 国产精品第一区| 免费的成人av| 久久av最新网址| 亚洲国产精品成人一区二区| 欧美一区二区三区另类| 一区二区三区国产在线观看| 欧美性大战久久久久久久| 欧美综合国产| 亚洲人成7777| 久久久噜久噜久久综合| 亚洲与欧洲av电影| 黄色在线成人| 中文精品在线| 亚洲日韩成人| 欧美激情影院| 欧美高清在线精品一区| 美女久久一区| 久久最新视频| 欧美成人乱码一区二区三区| 欧美一区二区啪啪| 欧美一区二区三区视频在线| 久久成人人人人精品欧| 久久本道综合色狠狠五月| 欧美中文字幕在线视频| 久久精品国产一区二区三| 久久国产精品72免费观看| 欧美一区观看| 美女精品在线观看| 最新精品在线| 亚洲免费在线播放| 久久久久99精品国产片| 免费成人高清视频| 亚洲精品一区二| 一区二区三区精品| 亚洲综合精品四区| 久热精品在线视频| 欧美日韩在线综合| 国产女主播一区二区| 亚洲精品乱码久久久久久按摩观| 亚洲视屏在线播放| 老司机一区二区三区| 99re66热这里只有精品3直播| 性色av一区二区三区|