<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<!-- DOMjudge version 3.3.2 -->
<title>Source: s1317</title>
<link rel="shortcut icon" href="../images/favicon.png" type="image/png" />
<link rel="stylesheet" href="../style.css" type="text/css" />
<link rel="stylesheet" href="style_jury.css" type="text/css" />
<script type="text/javascript" src="../js/sorttable.js"></script>
<script type="text/javascript" src="../js/domjudge.js"></script>
</head>
<body>

<h2>Source code for submission s1317</h2>

<p><a href="#diff">Go to diff to previous submission</a></p>

<div class="tabber"><div class="tabbertab"><h2 class="filename"><a name="source0"></a>sablona.cc</h2> 

<pre class="cpp" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;cstdio&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;iostream&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;algorithm&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;vector&gt;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;set&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;map&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;string&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;cmath&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;cstdlib&gt;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;cstring&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;sstream&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;stdio.h&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;ctype.h&gt;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;math.h&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;string.h&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include &lt;stdlib.h&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#define X first</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#define Y second</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#define MP make_pair</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#define PB push_back</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#define SZ size</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">struct</span> Dvojice <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #0000ff;">int</span> zac<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #0000ff;">char</span> smer<span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">int</span> compare <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">const</span> <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span>a, <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span>b<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #0000ff;">struct</span> Dvojice a1 <span style="color: #000080;">=</span> <span style="color: #000040;">*</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">struct</span> Dvojice<span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span>a<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #0000ff;">struct</span> Dvojice b1 <span style="color: #000080;">=</span> <span style="color: #000040;">*</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">struct</span> Dvojice<span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span>b<span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #0000ff;">return</span> <span style="color: #008000;">&#40;</span>a1.<span style="color: #007788;">zac</span><span style="color: #000040;">-</span>b1.<span style="color: #007788;">zac</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">&#123;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #0000ff;">int</span> a, b, c, d, f, g, aa, i, ii, akt, akt2, j, k, ok2, ok, pom1, pom2, cas1, cas2, max<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #0000ff;">char</span> e<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #0000ff;">struct</span> Dvojice mrv<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">100005</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #0000ff;">while</span> <span style="color: #008000;">&#40;</span><span style="color: #0000dd;">scanf</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;%d %d&quot;</span>, <span style="color: #000040;">&amp;</span>a, <span style="color: #000040;">&amp;</span>b<span style="color: #008000;">&#41;</span> <span style="color: #000080;">&gt;</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      max <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span>i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i <span style="color: #000080;">&lt;</span> b<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #0000dd;">scanf</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;%d %c<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #000040;">&amp;</span>c, <span style="color: #000040;">&amp;</span>e<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         mrv<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span> <span style="color: #000080;">=</span> c<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         mrv<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">=</span> e<span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>e <span style="color: #000080;">==</span> <span style="color: #FF0000;">'R'</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>a <span style="color: #000040;">-</span> c <span style="color: #000080;">&gt;</span> max<span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               max <span style="color: #000080;">=</span> a <span style="color: #000040;">-</span> c<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #008000;">&#125;</span> <span style="color: #0000ff;">else</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>c <span style="color: #000080;">&gt;</span> max<span style="color: #008000;">&#41;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               max <span style="color: #000080;">=</span> c<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      <span style="color: #0000dd;">qsort</span><span style="color: #008000;">&#40;</span>mrv, b, <span style="color: #0000dd;">sizeof</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">struct</span> Dvojice<span style="color: #008000;">&#41;</span>, compare<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      d <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      f <span style="color: #000080;">=</span> b <span style="color: #000040;">-</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      ok2 <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      pom1 <span style="color: #000080;">=</span> d <span style="color: #000040;">+</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      pom2 <span style="color: #000080;">=</span> f <span style="color: #000040;">-</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      <span style="color: #0000ff;">while</span><span style="color: #008000;">&#40;</span>d <span style="color: #000040;">+</span> <span style="color: #0000dd;">1</span> <span style="color: #000080;">&lt;</span> f <span style="color: #000040;">&amp;&amp;</span> ok2 <span style="color: #000080;">==</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         ok <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #666666;">//pom1 = d + 1;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #666666;">//pom2 = f - 1;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #0000ff;">while</span> <span style="color: #008000;">&#40;</span>ok <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>mrv<span style="color: #008000;">&#91;</span>pom1<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000040;">!</span><span style="color: #000080;">=</span> mrv<span style="color: #008000;">&#91;</span>d<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               ok <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #008000;">&#125;</span> <span style="color: #0000ff;">else</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               pom1<span style="color: #000040;">++</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>pom1 <span style="color: #000080;">&gt;</span> f<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               ok <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               pom1 <span style="color: #000080;">=</span> <span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         ok <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #0000ff;">while</span> <span style="color: #008000;">&#40;</span>ok <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>mrv<span style="color: #008000;">&#91;</span>pom2<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000040;">!</span><span style="color: #000080;">=</span> mrv<span style="color: #008000;">&#91;</span>f<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               ok <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #008000;">&#125;</span> <span style="color: #0000ff;">else</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               pom2<span style="color: #000040;">++</span><span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>pom2 <span style="color: #000080;">&lt;</span> d<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               ok <span style="color: #000080;">=</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               pom2 <span style="color: #000080;">=</span> <span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>pom1 <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            cas1 <span style="color: #000080;">=</span> mrv<span style="color: #008000;">&#91;</span>pom1<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span> <span style="color: #000040;">-</span> mrv<span style="color: #008000;">&#91;</span>d<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>pom2 <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            cas2 <span style="color: #000080;">=</span> mrv<span style="color: #008000;">&#91;</span>f<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span> <span style="color: #000040;">-</span> mrv<span style="color: #008000;">&#91;</span>pom2<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>pom1 <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>cas1 <span style="color: #000080;">==</span> cas2<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>mrv<span style="color: #008000;">&#91;</span>pom2<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">==</span> <span style="color: #FF0000;">'R'</span><span style="color: #008000;">&#41;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  mrv<span style="color: #008000;">&#91;</span>pom2<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">'L'</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000ff;">else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  mrv<span style="color: #008000;">&#91;</span>pom2<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">'R'</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               f<span style="color: #000040;">--</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>mrv<span style="color: #008000;">&#91;</span>pom1<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">==</span> <span style="color: #FF0000;">'R'</span><span style="color: #008000;">&#41;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  mrv<span style="color: #008000;">&#91;</span>pom1<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">'L'</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000ff;">else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  mrv<span style="color: #008000;">&#91;</span>pom1<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">'R'</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               d<span style="color: #000040;">++</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>pom1 <span style="color: #000080;">&gt;</span> pom2<span style="color: #008000;">&#41;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  pom1 <span style="color: #000080;">=</span> d <span style="color: #000040;">+</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>pom2 <span style="color: #000080;">&lt;</span> pom1<span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  pom2 <span style="color: #000080;">=</span> f <span style="color: #000040;">-</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      <span style="color: #666666;">//pom2 = f - 1;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #008000;">&#125;</span> <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>cas1 <span style="color: #000080;">&gt;</span> cas2<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>mrv<span style="color: #008000;">&#91;</span>pom2<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">==</span> <span style="color: #FF0000;">'R'</span><span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  mrv<span style="color: #008000;">&#91;</span>pom2<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">'L'</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000ff;">else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  mrv<span style="color: #008000;">&#91;</span>pom2<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">'R'</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               f<span style="color: #000040;">--</span><span style="color: #008080;">;</span>  </div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>pom1 <span style="color: #000080;">&gt;</span> pom2<span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  pom1 <span style="color: #000080;">=</span> d <span style="color: #000040;">+</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #008000;">&#125;</span> <span style="color: #0000ff;">else</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>mrv<span style="color: #008000;">&#91;</span>pom1<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">==</span> <span style="color: #FF0000;">'R'</span><span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  mrv<span style="color: #008000;">&#91;</span>pom1<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">'L'</span><span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000ff;">else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  mrv<span style="color: #008000;">&#91;</span>pom1<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">=</span> <span style="color: #FF0000;">'R'</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               d<span style="color: #000040;">++</span><span style="color: #008080;">;</span> </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>pom2 <span style="color: #000080;">&lt;</span> pom1<span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  pom2 <span style="color: #000080;">=</span> f <span style="color: #000040;">-</span> <span style="color: #0000dd;">1</span><span style="color: #008080;">;</span> </div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #008000;">&#125;</span> <span style="color: #0000ff;">else</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            ok2 <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #666666;">//printf(&quot;%d %d\n&quot;, d, f);</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>ok2 <span style="color: #000080;">==</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>mrv<span style="color: #008000;">&#91;</span>d<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">smer</span> <span style="color: #000080;">==</span> <span style="color: #FF0000;">'L'</span><span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;The last ant will fall down in %d seconds - started at %d.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, max, mrv<span style="color: #008000;">&#91;</span>f<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #0000ff;">else</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;The last ant will fall down in %d seconds - started at %d.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, max, mrv<span style="color: #008000;">&#91;</span>d<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      <span style="color: #008000;">&#125;</span> <span style="color: #0000ff;">else</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #666666;">//printf(&quot;%d\n&quot;, mrv[f].zac);</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>a <span style="color: #000040;">-</span> mrv<span style="color: #008000;">&#91;</span>f<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span> <span style="color: #000080;">&gt;</span> mrv<span style="color: #008000;">&#91;</span>d<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span><span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;The last ant will fall down in %d seconds - started at %d.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, max, mrv<span style="color: #008000;">&#91;</span>d<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>a <span style="color: #000040;">-</span> mrv<span style="color: #008000;">&#91;</span>f<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span> <span style="color: #000080;">&lt;</span> mrv<span style="color: #008000;">&#91;</span>d<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span><span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;The last ant will fall down in %d seconds - started at %d.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, max, mrv<span style="color: #008000;">&#91;</span>f<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #0000ff;">else</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>f <span style="color: #000080;">&gt;</span> d<span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;The last ant will fall down in %d seconds - started at %d and %d.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, max, mrv<span style="color: #008000;">&#91;</span>d<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span>, mrv<span style="color: #008000;">&#91;</span>f<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #0000ff;">else</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">               <span style="color: #0000dd;">printf</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;The last ant will fall down in %d seconds - started at %d and %d.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, max, mrv<span style="color: #008000;">&#91;</span>f<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span>, mrv<span style="color: #008000;">&#91;</span>d<span style="color: #008000;">&#93;</span>.<span style="color: #007788;">zac</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">         <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">      <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">   <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre></div></div><h2><a name="diff"></a>Diff to submission <a href="1257">s1257</a></h2>
<div class="tabber"><div class="tabbertab"><h2 class="filename"><a name="diff"></a>sablona.cc</h2>

<pre class="output_text"><span class='diff-del'>--- c4.s1257.cteam079.ants.cpp.0.sablona.cc</span>
<span class='diff-add'>+++ c4.s1317.cteam079.ants.cpp.0.sablona.cc</span>
@@ -60,8 +60,10 @@
       f = b - 1;
       ok2 = 1;
<span class='diff-del'>-      while(d &lt; f &amp;&amp; ok2 == 1) {</span>
<span class='diff-add'>+      pom1 = d + 1;</span>
<span class='diff-add'>+      pom2 = f - 1;</span>
<span class='diff-add'>+      while(d + 1 &lt; f &amp;&amp; ok2 == 1) {</span>
          ok = 0;
<span class='diff-del'>-         pom1 = d + 1;</span>
<span class='diff-del'>-         pom2 = f - 1;</span>
<span class='diff-add'>+         //pom1 = d + 1;</span>
<span class='diff-add'>+         //pom2 = f - 1;</span>
          while (ok == 0) {
             if (mrv[pom1].smer != mrv[d].smer) {
@@ -105,4 +107,9 @@
                   mrv[pom1].smer = 'R';
                d++;
<span class='diff-add'>+               if (pom1 &gt; pom2)</span>
<span class='diff-add'>+                  pom1 = d + 1;</span>
<span class='diff-add'>+               if (pom2 &lt; pom1)</span>
<span class='diff-add'>+                  pom2 = f - 1;</span>
<span class='diff-add'>+      //pom2 = f - 1;</span>
             } else if (cas1 &gt; cas2) {
                if (mrv[pom2].smer == 'R')
@@ -111,4 +118,6 @@
                   mrv[pom2].smer = 'R';
                f--;  
<span class='diff-add'>+               if (pom1 &gt; pom2)</span>
<span class='diff-add'>+                  pom1 = d + 1;</span>
             } else {
                if (mrv[pom1].smer == 'R')
@@ -116,5 +125,7 @@
                else
                   mrv[pom1].smer = 'R';
<span class='diff-del'>-               d++;  </span>
<span class='diff-add'>+               d++; </span>
<span class='diff-add'>+               if (pom2 &lt; pom1)</span>
<span class='diff-add'>+                  pom2 = f - 1; </span>
             }
          } else {
@@ -129,10 +140,15 @@
             printf(&quot;The last ant will fall down in %d seconds - started at %d.\n&quot;, max, mrv[d].zac);
       } else {
<span class='diff-del'>-         if (a - mrv[d].zac &gt; mrv[f].zac)</span>
<span class='diff-add'>+         //printf(&quot;%d\n&quot;, mrv[f].zac);</span>
<span class='diff-add'>+         if (a - mrv[f].zac &gt; mrv[d].zac)</span>
             printf(&quot;The last ant will fall down in %d seconds - started at %d.\n&quot;, max, mrv[d].zac);
<span class='diff-del'>-         else if (a - mrv[d].zac &gt; mrv[f].zac)</span>
<span class='diff-add'>+         else if (a - mrv[f].zac &lt; mrv[d].zac)</span>
             printf(&quot;The last ant will fall down in %d seconds - started at %d.\n&quot;, max, mrv[f].zac);
<span class='diff-del'>-         else</span>
<span class='diff-del'>-            printf(&quot;The last ant will fall down in %d seconds - started at %d and %d.\n&quot;, max, mrv[f].zac, mrv[d].zac);</span>
<span class='diff-add'>+         else {</span>
<span class='diff-add'>+            if (f &gt; d)</span>
<span class='diff-add'>+               printf(&quot;The last ant will fall down in %d seconds - started at %d and %d.\n&quot;, max, mrv[d].zac, mrv[f].zac);</span>
<span class='diff-add'>+            else</span>
<span class='diff-add'>+               printf(&quot;The last ant will fall down in %d seconds - started at %d and %d.\n&quot;, max, mrv[f].zac, mrv[d].zac);</span>
<span class='diff-add'>+         }</span>
       }
    }
</pre>

</div></div>
</body>
</html>
