[tutorial:919A]↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/3473480397612) (C++ version)↵
↵
[tutorial:919B]↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/3473483697624) (C++ version)↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/3473484597628) (Python version)↵
↵
[tutorial:919C]↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/3473487097644) (C++ version)↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/3473490997654) (Python version)↵
↵
[tutorial:919D]↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/3473493297673) (C++ version)↵
↵
[tutorial:919E]↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/3473497197680) (C++ version)↵
↵
[tutorial:919F]↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/3473499297700) (My stupid solution: C++ version)↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/34797525694) ([user:demon1999,2018-02-01]'s fast solution: C++11 version)↵
↵
**UPD1:** Note that the editorial of problem E is modified with some correction. Sorry for that inconvenience.↵
↵
**UPD2:** The editorial is complete now. Hope you find it useful. :P
↵
[Code](http://mirror.codeforces.com/contest/919/submission/347
↵
[tutorial:919B]↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/347
↵
[Code](http://mirror.codeforces.com/contest/919/submission/347
↵
[tutorial:919C]↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/347
↵
[Code](http://mirror.codeforces.com/contest/919/submission/347
↵
[tutorial:919D]↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/347
↵
[tutorial:919E]↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/347
↵
[tutorial:919F]↵
↵
[Code](http://mirror.codeforces.com/contest/919/submission/347
↵
[Code](http://mirror.codeforces.com/contest/919/submission/34797
↵
**UPD1:** Note that the editorial of problem E is modified with some correction. Sorry for that inconvenience.↵
↵
**UPD2:** The editorial is complete now. Hope you find it useful. :P