<?xml version="1.0" encoding="UTF-8"?>
<problem
    version="1.0"
    id ="ru.ifmo.neerc.io.2014-2015.20150214i.webbuy"
>
    <judging>
        <script type="%ioi">
            <testset
                name="preliminary"

                input-name  ="webbuy.in"
                output-name ="webbuy.out"
                input-href  ="preliminary/##"
                answer-href ="preliminary/##.a"

                time-limit = "2s"
                memory-limit ="268435456"
            >
                <test points="0" comment="sample 1"/>
                <test points="0" comment="sample 2"/>
            </testset>

            <testset
                name ="main"
                input-name  ="webbuy.in"
                output-name ="webbuy.out"
                input-href  ="tests/##"
                answer-href ="tests/##.a"

                time-limit ="2s"
                memory-limit ="268435456"
            >
                <test-group
                    comment = "n &lt;= 1000, c = 0"
                    score = "sum"
                    feedback = "outcome"
                    group-bonus = "50"
                >
                    <test points = "0" comment = "aaaaaaaaa, a = 1, b = 2, c = 0"/>                
                    <test points = "0" comment = "bbbbbbb, a = 3, b = 1, c = 0"/>                
                    <test points = "0" comment = "qwertyuiopasdfghjklzxcvbnm, a = 100, b = 0, c = 0"/>                
                    <test points = "0" comment = "abacabaabacabacabaabac, a = 100, b = 5, c = 0"/>                
                    <test points = "0" comment = "periodic uaosnzwtqyl, a = 90798316, b = 101535843, c = 0"/>                
                    <test points = "0" comment = "periodic hzzkxwu, a = 593320411, b = 201438814, c = 0"/>                
                    <test points = "0" comment = "random test, a = 76594661, b = 8, c = 0"/>                
                    <test points = "0" comment = "random test, a = 10, b = 747335687, c = 0"/>                
                    <test points = "0" comment = "random test, a = 339146438, b = 162335373, c = 0"/>                
                    <test points = "0" comment = "862 symbols v, a = 227506868, b = 197192744, c = 0"/>                
                    <test points = "0" comment = "989 symbols a, a = 21, b = 991564581, c = 0"/>                
                    <test points = "0" comment = "834 symbols a, a = 593083299, b = 7, c = 0"/>                
                    <test points = "0" comment = "periodic qdm, a = 62031102, b = 38317134, c = 0"/>                
                    <test points = "0" comment = "periodic xqloqauucbxrs, a = 922821510, b = 266042646, c = 0"/>                
                    <test points = "0" comment = "random test, a = 396334449, b = 2, c = 0"/>                
                    <test points = "0" comment = "random test, a = 16, b = 616291961, c = 0"/>                
                    <test points = "0" comment = "random test, a = 582718406, b = 260647488, c = 0"/>                
                    <test points = "0" comment = "753 symbols l, a = 75774611, b = 301997905, c = 0"/>                
                    <test points = "0" comment = "634 symbols v, a = 34, b = 276013063, c = 0"/>                
                    <test points = "0" comment = "891 symbols l, a = 60495548, b = 13, c = 0"/>                
                    <test points = "0" comment = "periodic nkz, a = 104232947, b = 450570215, c = 0"/>                
                    <test points = "0" comment = "periodic bezltrimqxchcrfjwmkn, a = 576709764, b = 117747548, c = 0"/>                
                    <test points = "0" comment = "random test, a = 938729983, b = 0, c = 0"/>                
                    <test points = "0" comment = "random test, a = 1, b = 698228894, c = 0"/>                
                    <test points = "0" comment = "random test, a = 812435332, b = 691236237, c = 0"/>                
                    <test points = "0" comment = "533 symbols b, a = 178886898, b = 968682282, c = 0"/>                
                    <test points = "0" comment = "538 symbols i, a = 33, b = 558217185, c = 0"/>                
                    <test points = "0" comment = "588 symbols c, a = 534794750, b = 21, c = 0"/>                
                    <test points = "0" comment = "periodic aba, a = 478849838, b = 379586486, c = 0"/>                
                    <test points = "0" comment = "periodic abc, a = 1000000000, b = 1000000000, c = 0"/>                
                    <test points = "0" comment = "random test, a = 1000000000, b = 1000000000, c = 0"/>                
                    <test points = "0" comment = "1000 symbols l, a = 1000000000, b = 1000000000, c = 0"/>                
                </test-group>

                <test-group
                    comment = "n &lt;= 100000"
                    score = "sum"
                    feedback = "outcome"
                    group-bonus = "50"
                >
                    <test points = "0" comment = "aaaaaaaaa, a = 1, b = 2, c = 1"/>                
                    <test points = "0" comment = "bbbbbbb, a = 3, b = 1, c = 1"/>                
                    <test points = "0" comment = "qwertyuiopasdfghjklzxcvbnm, a = 100, b = 0, c = 30"/>                
                    <test points = "0" comment = "abacabaabacabacabaabac, a = 100, b = 5, c = 1"/>                
                    <test points = "0" comment = "periodic qhjsd, a = 947905352, b = 205345789, c = 180856115"/>                
                    <test points = "0" comment = "periodic bdntalomhuqzm, a = 855469835, b = 59706859, c = 233715759"/>                
                    <test points = "0" comment = "random test, a = 26248370, b = 3, c = 641337580"/>                
                    <test points = "0" comment = "random test, a = 15, b = 596959654, c = 135944850"/>                
                    <test points = "0" comment = "random test, a = 319463310, b = 9246388, c = 522145"/>                
                    <test points = "0" comment = "87861 symbols k, a = 539661560, b = 393782305, c = 4"/>                
                    <test points = "0" comment = "72835 symbols j, a = 47, b = 559532429, c = 0"/>                
                    <test points = "0" comment = "79086 symbols f, a = 643502847, b = 14, c = 204919791"/>                
                    <test points = "0" comment = "periodic brxmlsyatjf, a = 181381893, b = 29540472, c = 126013920"/>                
                    <test points = "0" comment = "periodic nojymhcjfslaqzcbosw, a = 158339860, b = 222783933, c = 109710879"/>                
                    <test points = "0" comment = "random test, a = 554734321, b = 3, c = 829933411"/>                
                    <test points = "0" comment = "random test, a = 13, b = 321386349, c = 99226427"/>                
                    <test points = "0" comment = "random test, a = 904038002, b = 553272540, c = 390226803"/>                
                    <test points = "0" comment = "57597 symbols b, a = 915871925, b = 106025083, c = 4"/>                
                    <test points = "0" comment = "64800 symbols z, a = 20, b = 53572206, c = 4"/>                
                    <test points = "0" comment = "90733 symbols s, a = 713817259, b = 3, c = 33114515"/>                
                    <test points = "0" comment = "periodic chlpk, a = 804587755, b = 166755140, c = 352171799"/>                
                    <test points = "0" comment = "periodic opacqd, a = 156844610, b = 152776852, c = 107609843"/>                
                    <test points = "0" comment = "random test, a = 92690241, b = 9, c = 806174560"/>                
                    <test points = "0" comment = "random test, a = 23, b = 100845949, c = 253920248"/>                
                    <test points = "0" comment = "random test, a = 393623398, b = 488706235, c = 105582055"/>                
                    <test points = "0" comment = "82786 symbols k, a = 989701545, b = 181819677, c = 8"/>                
                    <test points = "0" comment = "59388 symbols b, a = 46, b = 485833098, c = 5"/>                
                    <test points = "0" comment = "93938 symbols a, a = 830433128, b = 16, c = 272556287"/>                
                    <test points = "0" comment = "periodic pffyju, a = 634160277, b = 239358243, c = 415127891"/>                
                    <test points = "0" comment = "periodic yjprulebrbpbi, a = 74631490, b = 463222985, c = 271669695"/>                
                    <test points = "0" comment = "random test, a = 439333836, b = 3, c = 821249652"/>                
                    <test points = "0" comment = "random test, a = 3, b = 850681577, c = 327318374"/>                
                    <test points = "0" comment = "random test, a = 555834082, b = 302064615, c = 479040412"/>                
                    <test points = "0" comment = "54375 symbols k, a = 56243676, b = 252764652, c = 6"/>                
                    <test points = "0" comment = "50256 symbols n, a = 22, b = 893701016, c = 2"/>                
                    <test points = "0" comment = "69588 symbols e, a = 176181763, b = 8, c = 100209599"/>                
                    <test points = "0" comment = "periodic aba, a = 555043200, b = 865009614, c = 973657041"/>                
                    <test points = "0" comment = "periodic abc, a = 1000000000, b = 1000000000, c = 1000000000"/>                
                    <test points = "0" comment = "random test, a = 1000000000, b = 1000000000, c = 1000000000"/>                
                    <test points = "0" comment = "100000 symbols z, a = 1000000000, b = 1000000000, c = 1000000000"/>                
                </test-group>

            </testset>

            <verifier type="%testlib">
                <binary executable-id ="java.check" file ="check.jar" />
            </verifier>
        </script>
    </judging>
</problem>
