Vova, the Ultimate Thule new shaman, wants to build a pipeline. As there are exactly
A splitter is a construction that consists of one input (it can be connected to a water pipe) and
Vova has one splitter of each kind: with
Vova needs the pipeline to have exactly
The first line contains two space-separated integers
Please, do not use the
Print a single integer — the minimum number of splitters needed to build the pipeline. If it is impossible to build a pipeline with the given splitters, print -1.
4 3
2
5 5
1
8 4
-1
#include <stdio.h>
#include <iostream>
#include <string>
#include <string.h>
#include <algorithm>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <map>
using namespace std;
typedef long long ll;
int main(){
return 0;
}