{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"![Po](CDN_BASE_URL/adb4149afffb531a6b3103cba9c33b12?v\u003d1715255668)\n\nValley of Peace is not only famous for Inner Peace but also well known for the delicious pizzas of Mr. Ping, the goose father of legendary Kung Fu Panda Po.\n\nThe delicious pizza of Mr. Ping has become so much famous that the demand of it has increased to a great extent. Mr. Ping wants to deliver his pizzas to Gongmen City which is ruled by Evil Lord Shen. Wolf bandits are guarding the Gongmen City and everywhere else. So, there are some fixed allowable amounts of pizza **C\u003csub\u003ek\u003c/sub\u003e** that can be carried through **k\u003csup\u003eth\u003c/sup\u003e** road. For some reason, the roads are one way only. Assume that there are **N** cities, Valley of Peace is the **1\u003csup\u003est\u003c/sup\u003e** city and Gongmen City is the **N\u003csup\u003eth\u003c/sup\u003e** city.\n\nMr. Ping along with Master Shifu has calculated the demands for each city and a **least** amount of pizzas **L\u003csub\u003ek\u003c/sub\u003e (\u0026le; C\u003csub\u003ek\u003c/sub\u003e)** for **k\u003csup\u003eth\u003c/sup\u003e** road that must be sent to satisfy the demands. Mr. Ping always wanted Po to become a great chef like him but Panda Po was busy practicing Kung Fu. So, now Mr. Ping has given him the job to deliver pizzas to Gongmen City fulfilling the requirements stated above.\n\nPo along with his team cannot carry more or not even less than allowable amount assigned for each road, otherwise Stealth Mode will be broken and they will get caught. If the amount of pizzas going through the road from **i\u003csup\u003eth\u003c/sup\u003e** city to **j\u003csup\u003eth\u003c/sup\u003e (1 \u0026lt; i, j \u0026lt; N)** city is **F\u003csub\u003eij\u003c/sub\u003e**, then for each **i**, the following condition must hold:\n\n$$\\sum_{i\u003d1}^N F_{ij} \u003d \\sum_{i\u003d1}^N F_{ji}$$\n\nPo is very excited to complete this awesome task along with Thundering Rhino and all helping hands possible. As you are a good friend of Panda; he wanted your help to know if it is possible to get this job done."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 20)**, denoting the number of test cases.\n\nEach case starts with a blank line. Next line contains two integers **N (2 \u0026le; N \u0026le; 200)** and **M** where **N** denotes the number of cities and **M** denotes the number of unidirectional roads. The **k\u003csup\u003eth\u003c/sup\u003e** line of the next **M** lines contains four integers **u\u003csub\u003ek\u003c/sub\u003e v\u003csub\u003ek\u003c/sub\u003e L\u003csub\u003ek\u003c/sub\u003e C\u003csub\u003ek\u003c/sub\u003e (1 \u0026le; u\u003csub\u003ek\u003c/sub\u003e \u0026lt; N and 1 \u0026lt; v\u003csub\u003ek\u003c/sub\u003e \u0026le; N, u\u003csub\u003ek\u003c/sub\u003e \u0026ne; v\u003csub\u003ek\u003c/sub\u003e, 0 \u0026le; L\u003csub\u003ek\u003c/sub\u003e \u0026le; C\u003csub\u003ek\u003c/sub\u003e \u0026le; 10\u003csup\u003e5\u003c/sup\u003e)** meaning that there is a road from city **u\u003csub\u003ek\u003c/sub\u003e** to **v\u003csub\u003ek\u003c/sub\u003e**, and at least **L\u003csub\u003ek\u003c/sub\u003e** units of pizza must be sent through this road but not exceeding **C\u003csub\u003ek\u003c/sub\u003e** units. There can be at most one road from a city **u** to **v** and from any city **u**, it\u0027s impossible to return to **u** visiting other cities."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and `yes` if it\u0027s possible to deliver the pizzas maintaining the restrictions, or `no` otherwise. If it\u0027s possible to do so, print extra **M** lines, where the **k\u003csup\u003eth\u003c/sup\u003e** line should contain the amount of pizza that should be sent through the **k\u003csup\u003eth\u003c/sup\u003e** road. There can be multiple solutions, report any valid one."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\n\n2 1\n1 2 5 10\n\n4 5\n1 2 3 4\n1 3 2 3\n3 2 2 5\n3 4 2 3\n2 4 4 10\n\n4 5\n1 2 3 5\n1 3 2 10\n3 2 2 5\n3 4 2 3\n2 4 6 10\n\n5 4\n1 4 5 5\n4 2 3 5\n2 3 3 5\n3 5 0 10\n\n5 5\n1 4 5 5\n4 2 3 5\n2 3 3 5\n3 5 0 10\n1 5 0 10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: yes\n5\nCase 2: no\nCase 3: yes\n4\n4\n2\n2\n6\nCase 4: yes\n5\n5\n5\n5\nCase 5: yes\n5\n5\n5\n5\n0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"MD","content":"* Dataset is huge, use faster I/O methods.\n* This is a special judge problem; wrong output format may cause \u0027Wrong Answer\u0027."}}]}